#!/usr/bin/perl # Routine to remove the DATA_STREAM_TYPE from the labels of the stardust files $SRCDIR = "."; $NEWDIR = "newlabels"; $TMPLBL = "TMP.LBL"; mkdir $NEWDIR, 0755; opendir(SRC,$SRCDIR); foreach $file (readdir(SRC)) { print "--$file--\n"; next if not ($file =~ /lbl/); # Open image file, read it to create new PDS label and FITS header. { my ($img,$label,$not_done); print,"$file\n"; $img = "$SRCDIR/$file"; $label = "$NEWDIR/$file"; $label =~ tr/A-Z/a-z/; # Open the various files: open(IMG,$img) || die "Could not open source image pipe ($!)"; open(LBL,"| fixlen -c > $label") || die "Could not open label pipe ($!)"; # Digging through the label file: $not_done = 1; while (($line=) && $not_done) { next if ($line =~ /DATA_STREAM_TYPE/); printf LBL $line; } # printf LBL $line; close(IMG); close(LBL); # That's it for the label. } } closedir(SRC); #=============================================================================