function [dat]=rd_TimeStp(fnam,digital_port_number)
%
%  Program to read DH-4 timestp file
%
%  INPUTS
%    FNAM = file name to read in.
%
%  OUTPUTS
%    
%  	
%    dat = timestamps
%
%
%  Written by Emmanuel Boss, U of Maine, 2002.
%   

fid=fopen(fnam,'r')

%skip first line  
j=1;
while(feof(fid)==0)
      line=fgetl(fid);
      for i=1:digital_port_number*2 %2 per digital port
         junk=fscanf(fid,'%s',[4]);
         dat1(i)=fscanf(fid,'%f',[1]);
         line=fgetl(fid);
     end
     dat(j,:)=dat1(1:digital_port_number*2);
     j=j+1
     clear dat1
end
fclose(fid);