#!perl =head2 Description Input should be the result of fieldextraction.pl. Output is same field, without count, tag number, indicators, or first subfield code. =cut print "Input file: "; $inputfile = <>; chomp $inputfile; $inputfile =~ s/^\"(.*)\"$/$1/; print "Export file: "; $exportfile = <>; chomp $exportfile; $exportfile =~ s/^\"(.*)\"$/$1/; open (IN, "<$inputfile") || die ("can't open in"); open (OUT, ">$exportfile") || die ("can't open out"); my $linecount = 0; #read lines from input file while (my $line = ) { chomp $line; #give user notification that program is working if ($linecount%1000 == 0) {print "passing $linecount\n";} #remove extra spaces placed between subfields #(a side effect of the fieldextraction.pl script) $line =~ s/\t\s{7}\@/\t\@/g; #remove count, tab, 3 digit tagno, space, ind1, ind2, #space, subfield indicator, subfield code, and tab $line =~ s/^\d+?\t\d{3}\s[ \d][ \d]\s\@\w\t//; print OUT ("$line\n"); $linecount++; } close IN; close OUT; print "$linecount lines cleaned\n"; print "Press Enter to quit"; <>;