function [time, P, T, C, S, V1, V2, D]=rd_SBE19(fnam)
%
%  Program to read DH-4 SBE37 output file
%
%  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')

%skip header
line=fgetl(fid);
junk=0;
i=1;
while(feof(fid)==0)
      junk=fscanf(fid,'%f',[8]);
      if isempty(junk)
          break
      end    
      dat1([1:8])=junk([1:8]);
      dat(i,:)=dat1;
      i=i+1;
      clear junk
end
P=dat(:,2);
T=dat(:,3);
C=dat(:,4);
S=dat(:,5);
V1=dat(:,6);
V2=dat(:,7);
D=dat(:,8);
time=dat(:,1);
fclose(fid);
