#!/usr/bin/perl # Merge the new and old records into a single updated data file, cherry- # picking the data fields. open(OLD,"tmp.new") || die "Could not open tmp.new ($!)"; open(ALL,"tmp.all") || die "Could not open tmp.all ($!)"; open(NEW,">tmp.merge") || die "Could not open tmp.merge ($!)"; while ($oline=) { $aline=; $obstime = substr($aline,0,19); $filter = substr($aline,23,4); $wave = substr($aline,28,4); $band = substr($aline,33,3); $limit = substr($oline,56,1); $log_flux= substr($oline,59,7); $flux_err= substr($oline,67,5); $flux_err=~ s/ /-.999/; $aper = substr($aline,53,5); $rho = substr($aline,59,4); $theta = substr($aline,64,3); $inttime = substr($aline,68,2); $airmass = substr($oline,82,5); $obsname = substr($aline,77,25); $telescope = substr($aline,103,17); $tel_aper = substr($aline,121,4); $observer = substr($aline,126,26); $system = substr($oline,89,8); $file = substr($aline,153,8); printf NEW "$obstime $filter $wave $band $limit $log_flux"; printf NEW " $flux_err $aper $rho $theta $inttime $airmass"; printf NEW " $obsname $telescope $tel_aper $observer $system $file\n"; } close(OLD); close(ALL); close(NEW);