function [dat,len]=rdtaps6(file);
% Reads TAPS ASCII data files and parses them
% into date, time, etc.
% A sample calling sequence is:
%	file='''T060418.log''';
%	dat=rdtaps6(file);
%

if nargin~=1
   disp('Wrong number of arguments in call to readTAPS');
else   
end
dflag=0;len=0;cflag=0;
fid = fopen(file, 'r'); frewind(fid);
if fid==3;
   while ~ feof(fid)
      line=fgetl(fid);                % read one line of text
      if length(line)>0 & double(line(1))>47 & double(line(1))<58
         llen=length(line);
         iv=find(double(line)==32 | double(line)==9); % find spaces/taps
         x1=line(1:iv(1)-1);            % date
         date=str2num(x1);
         x1=line(iv(1)+1:iv(2));      % time;
         time=str2num(x1);
         x1=line(iv(2)+1:iv(3));      % depth;
         depth=str2num(x1);
         x1=line(iv(3)+1:iv(4));      % temperature
         temp=str2num(x1);
         x1=line(iv(4)+1:iv(5));      % ifreq1
         Ifreq1=str2num(x1);
         x1=line(iv(5)+1:iv(6));      % ifreq2
         Ifreq2=str2num(x1);
         x1=line(iv(6)+1:iv(7));      % Sv1
         sv1=str2num(x1);
         x1=line(iv(7)+1:iv(8));      % Sv2
         sv2=str2num(x1);
         x1=line(iv(8)+1:iv(9));      % Sv3
         sv3=str2num(x1);
         x1=line(iv(9)+1:iv(10));     % Sv4
         sv4=str2num(x1);
         x1=line(iv(10)+1:iv(11));    % Sv5
         sv5=str2num(x1);
         x1=line(iv(11)+1:llen);      % Sv6
         sv6=str2num(x1);
         
         % Put it into the right format for the RTDisp for East Sound 98
         td=[date time depth temp Ifreq1 Ifreq2 sv1 sv2 sv3 sv4 sv5 sv6];
            
         if dflag==0
            dat=td;
            dflag=1;
         else  
            dat=[dat;td];        % add td as next row of matrix
         end
      end     % of IF line(1) x~=32
   end   % of while ~ feof(fid)
else
   dat=[]; % Return null vector
	disp(['Error opening: ' file])
   fid
end   % of if fid==3
frewind(fid); fclose(fid);
