fid=fopen(infile,'rt');
dtform='%s %s';
% 44 more fields
ddform='%f %f %f %f %f %f %f %f %f %f ';
form=[dtform ddform ddform ddform ddform '%f %f %f %f'];
a=textscan(fid,form,'HeaderLines', 2, ...
     'emptyValue', -Inf, 'Delimiter', ',');
% fns = {'year', 'month', 'day','hour', 'minute','second', ...
fns = {'dstr','tstr', ...
    'Depth12', 'Depth35', 'atmp', 'bpr', 'lat', 'lon',  ...
    'tsgcond', 'tsgsst', 'GPS_COG', 'GPS_SOG', 'Gyro',  ...
    'precip', 'rainlevel', 'rainrate', 'hrh',  ...
    'sbecond', 'sbesal', 'sbetemp', 'sbesvel', 'SBE48T', 'Salinity', 'Fluorometer',  ...
    'swr',   ...
    'WS425_Dm', 'WS425_Sm', 'WS425_TD', 'WS425_TS', 'WS425_TS_cnt',  ...
    'WS425_TS_mean', 'WS425_TS_median', 'WS425_TS_rms', 'WS425_TS_sdev', 'WS425_TS_vari',  ...
    'relwdir', 'relwspd', 'wdir', 'wspd', 'WXT5_TS_cnt', 'WXT5_TS_mean', 'WXT5_TS_median',  ...
    'WXT5_TS_rms', 'WXT5_TS_sdev', 'WXT5_TS_vari', 'HdChkSum'};

ship=cell2struct(a,fns,2);

 mnpt=length(a{1});
 for ii=1:mnpt, 
     dstr=ship.dstr{ii}; tstr= ship.tstr{ii}; 
     dtstr=[dstr ' ' tstr];
     dv=sscanf(dtstr,'%f/%f/%f %f:%f:%f');
     ship.mday(ii,1)=datenum(dv');
 end
clear dv dstr tstr dtstr ;
ship=rmfield(ship,'dstr'); ship=rmfield(ship,'tstr');
fprintf('%s: %d %s\n', infile,mnpt,...
     datestr(ship.mday(mnpt)));

%npts=length(ship.mday);
fno=fieldnames(ship);
for i=1:size(fno,1)
    field_name=fno{i};
    if append==0,
        cmd=sprintf('%s=ship.%s;', field_name, field_name);
    else
         cmd=sprintf('%s=[%s; ship.%s];', field_name, field_name, field_name);
    end
    eval(cmd); 
end
npts=length(mday);
fprintf('%d new records\n', npts);
fclose all;

% R/V Oceanus Calliope CSV data file - OC449_I  (Time stamps are GMT)
% Date, Time_GMT, Depth12, Depth35, WXT5_Ta, WXT5_Pa, dec_lat, dec_lon, SSCND, SSTMP, GPS_COG, GPS_SOG, Gyro, PRC, WXT5_Rc, WXT5_Ri, WXT5_Ua, SBE45C, SBE45S, SBE45T, SBE45V, SBE48T, Salinity, Fluorometer, SWR, WS425_Dm, WS425_Sm, WS425_TD, WS425_TS, WS425_TS_cnt, WS425_TS_mean, WS425_TS_median, WS425_TS_rms, WS425_TS_sdev, WS425_TS_vari, WXT5_Dm, WXT5_Sm, WXT5_TD, WXT5_TS, WXT5_TS_cnt, WXT5_TS_mean, WXT5_TS_median, WXT5_TS_rms, WXT5_TS_sdev, WXT5_TS_vari, HdChkSum=09
% 2008/07/19, 00:00:52, 5769.00, 0.00, 27.60, 1017.5, 23.47545, -64.74632, 60.7067, 29.5773, 151.4, 11.80, 150.8, 0.00, 0.00, 0.0, 62.9, 59.81850, 36.2035, 29.7155, 1546.273, 29.8819, 36.9230, 73.68, -0.91, , , , , , , , , , , 334, 6.1, 48.7, 2.800, 6, 3.05, 3.12, 3.05, 0.19, 0.04, 09
% 2008/07/19, 00:01:52, 5762.00, 0.00, 27.60, 1017.7, 23.47253, -64.74462, 60.7238, 29.5962, 152.2, 11.80, 151.1, 0.00, 0.00, 0.0, 62.3, 59.89720, 36.2164, 29.7700, 1546.400, 29.8812, 36.9202, 78.00, -0.95, , , , , , , , , , , 328, 6.0, 44.5, 3.439, 6, 2.86, 2.81, 2.87, 0.32, 0.10, 09
% 2008/07/19, 00:02:53, 5768.00, 0.00, 27.70, 1017.8, 23.46975, -64.74290, 60.6616, 29.5416, 151.9, 11.90, 155.3, 0.00, 0.00, 0.0, 62.1, 59.93230, 36.2332, 29.7794, 1546.437, 29.8801, 36.9194, 72.96, -0.95, , , , , , , , , , , 334, 5.1, 26.1, 2.417, 6, 2.77, 2.67, 2.79, 0.37, 0.13, 09
 
 
% %R/V Oceanus Calliope CSV data file  (Time stamps are GMT)
% 1   2  3  4 5 6    7       8        9        10       11       12
%                       Vaisala WXT510 atmp    airptess  
% %Date,  Time_GMT, Depth12, Depth35, WXT5_Ta, WXT5_Pa, dec_lat, dec_lon,
% 2008 7 14 0 0 55  NaN      NaN      22       1009.5   41.5235 -70.6718
% 13(tsg)  14    15       16       17   18   19       20       21
%                                            rain level,rate   hrh
% SSCND, SSTMP, GPS_COG, GPS_SOG, Gyro, PRC, WXT5_Rc, WXT5_Ri, WXT5_Ua,
% 49.6688 25.9905 273.8    0.1     243.8  0     44.23     0       82.9
% 22       23      24      25      26      27         28           29
% SBE45C,  SBE45S, SBE45T, SBE45V, SBE48T, Salinity, Fluorometer, SWR,
% 0.2771  0.1252  28.6198 1506.03 22.8683 31.7959    118.56      4.14
% 30        31        32         33       34            35
%vaisala acoustic Rel Wind dir, spd, truedir,truespd  (all NaN)
% WS425_Dm, WS425_Sm, WS425_TD, WS425_TS, WS425_TS_cnt, WS425_TS_mean,
% NaN       NaN       NaN         NaN     NaN           NaN

% 36               37            38             39             
% WS425_TS_median, WS425_TS_rms, WS425_TS_sdev, WS425_TS_vari, 
% NaN                NaN           NaN           NaN            

% 40      41         42       43       44           45            46
% raw dir rawspd    truedir  truespd    
% WXT5_Dm, WXT5_Sm, WXT5_TD, WXT5_TS, WXT5_TS_cnt, WXT5_TS_mean, WXT5_TS_median,
% 287      6.1       170.3    6.112    6            5.45            5.56
% 47            48           49            50
% WXT5_TS_rms, WXT5_TS_sdev, WXT5_TS_vari, HdChkSum=09
% 5.48          0.61          0.37          9

% WXT5_Dm, WXT5_Sm, WXT5_TD, WXT5_TS, WXT5_TS_cnt,    40-44
%  334, 11.5, 145.2, 6.726, 6, <----- rel dir, spd, true dir, spd
% 2008/07/19, 00:00:52, 5769.00, 0.00, 27.60, 1017.5, 23.47545, -64.74632, 60.7067, 29.5773, 151.4, 11.80, 150.8, 0.00, 0.00, 0.0, 62.9, 59.81850, 36.2035, 29.7155, 1546.273, 29.8819, 36.9230, 73.68, -0.91, , , , , , , , , , , 334, 6.1, 48.7, 2.800, 6, 3.05, 3.12, 3.05, 0.19, 0.04, 09
% dtform='%.0f/%.0f/%.0f, %.0f:%.0f:.0f,';
