function [time FCHL]=rd_analog(fnam)
%
%  Program to read DH-4 analog files with n columns
%
%  INPUTS
%    FNAM = file name to read in.
%
%  OUTPUTS
%    
%  	
%    dat = analog data
%
%
%  Written by Emmanuel Boss, U of Maine, 2018 for EXPORTS01.
%   

fid=fopen(fnam,'r')

%fid=fopen('c:\data\CoBOP99\cobop990521_084025.dat','r')
%skip first 2 lines
for i=1:1   
   line=fgetl(fid);
end
i=1;
line=fgetl(fid);
junk=0;
i=1;
while(feof(fid)==0);
      dat1=fscanf(fid,'%f',[3]);
      if isempty(dat1);
          break
      end
      dat(i,:)=dat1([1, 3]);
      i=i+1;
      clear dat1
end
time=dat(:,1);
FCHL=dat(:,2);

fclose(fid);
