Home > reduc > support > readtracks.m

readtracks

PURPOSE ^

SYNOPSIS ^

function list=readtracks(fn)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function list=readtracks(fn)
0002 
0003 [home,installeddir]=where_am_i();
0004 fidr=fopen(sprintf('%s/%s/reduc/tracks/%s',home,installeddir,fn),'r');
0005 
0006 mon=getmonth;
0007 
0008 i=1;
0009 while(1)
0010   lin=fgets(fidr);
0011   if (lin==-1)
0012     break;
0013   else
0014     str=sscanf(lin,'%s');
0015     if (~checkstr(str))
0016       t1=str(1:20);
0017       f=find(strcmp(upper(mon),upper(t1(4:6))));
0018       if (f<10)
0019     month=sprintf('0%u',f);
0020       else
0021     month=sprintf('%u',f);
0022       end
0023       date=strcat(t1(8:11),month,t1(1:2));
0024       t2=str(21:40);
0025       name=str(41:end);
0026       list{i}={t1,t2,name,date}; 
0027       i=i+1;
0028     end
0029   end
0030 end
0031 
0032 fclose(fidr);
0033       
0034     
0035     
0036 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0037 function q=checkstr(str)
0038 
0039 if (isempty(str))
0040   q=1;
0041 else
0042   if (str(1)=='#')
0043     q=1;
0044   else
0045     q=0;
0046   end
0047 end

Generated on Sun 14-Jun-2015 17:12:45 by m2html © 2005