#!/usr/bin/perl # Routine to read the label files and apply the appropriate TARGET_NAME # correction (IUE Comet Data Base). # # Format: fixtarg # # Run from the "data" directory. # # Start by reading in the comet name list and parsing it into a hash for # reference: open (CLIST, "/home/raugh/iue_comet.list") || die "Could not open /home/raugh/iue_comet.list ($!)"; while ($line=) { chop $line; $line =~ s/^\s*//; $line =~ s/\s*$//; $line =~ /\((.*)\)/; $id = $1; $id =~ tr/A-Z/a-z/; $id =~ s/ /_/; $cname{$id} = "\"$line\""; # printf "ID: $id NAME: $cname{$id}\n"; } close (CLIST); # Do both directories: foreach $dir ("high", "low") { opendir (DIR,$dir) || die "Could not open $dir directory ($!)"; foreach $file (readdir DIR) { next if ($file !~ /^[0-9]{4}_/); $command = "chgtarget $cname{$file} $dir/$file"; printf "$command\n"; system $command; } closedir (DIR); }