function [time, ALT]=rd_ALT(fnam)
%
%  Program to read Altimeter DH4/WAP output file
%
%  INPUTS
%    FNAM = file name to read in.
%
%  OUTPUTS
%    
%  	
%    dat = analog data
%
%
%  Written by Emmanuel Boss, U of Maine, 2012.
%   

fid=fopen(fnam,'r')

%fid=fopen('C:\Documents and Settings\Emmanuel Boss\Desktop\RIVET2012\day1\archive_22_T_ASCII.000','r')

junk=0;
i=1;
while(feof(fid)==0)
      junk=fscanf(fid,'%f',[1]);
      if isempty(junk)
          break
      end
      char=fscanf(fid,'%s',[1]);
      if length(char)~=5
          char='error';
      end
      dat1([1])=junk([1]);
      dat(i,:)=dat1;
      str(i,:)=char;
      i=i+1;
      clear junk char
end
time=dat;
ALT=str;

fclose(fid);
