% mk_raw_flt.m - copies raw down files from shared disk and converts to
% .flt files
% this one for Oceanus oc415- eddies

cast = 21
if cast <10
  fn = ['oc41540',int2str(cast)];
elseif cast <100
  fn = ['oc4154',int2str(cast)];
end

% convert the files to .flt
eval(['!\ls -1 /mnt/oc415-4a/oc415_4/ctd/process/',fn,'.cnv > tmp'])
fid = fopen('tmp','r');
str=fread(fid);
fclose(fid);
aa = find(str == 10); % find the <cr>
ind=1;
for ii = 1:length(aa)
  s1 = setstr(str(ind:aa(ii)-1))';
  s2 = strrep(s1,'.cnv','.flt');
  eval(['!mk_flt_cnv.pl ',s1,' > ',s2])
  ind = aa(ii)+1;
end
