999999999999 XXXXXXXXXX #### #!/usr/bin/perl use CGI qw(:standard); open(INFO, "testdoc.txt"); print header(); print start_html(); my @record; my %hash; my $true = 0; $i =0; my $FEI; my $pack; ($sec,$min,$hour,$mday,$mon,$year,$wday, $yday,$isdst)=localtime(time); #printf "%4d-%02d-%02d %02d:%02d:%02d\n", $year+1900,$mon+1,$mday,$hour,$min,$sec; open (OUT, '>OUTPUT.txt'); while ($line = ){ # print $line . "
"; #check each character of the line for a page break for (split//,$line) { $test = sprintf "\%3o\n", ord $_; if ($test == 14) { # WE HAVE FOUND A NEW PAGE $true = 1; $hash->{$i} = printf("$line %d",$_); $i++; # store next 8 lines in a hash } } if ($true == 1){ $hash->{$i} = $line; print $hash->{i} . "
"; if ($i == 9){ if ($hash->{9} =~ /4\d{8}/ig) { $hash->{2} = " Heart Hospital\n"; } if ($hash->{2} =~ /Heart Hospital/){ $FEI = $hash->{6}; #print $FEI . "
"; switch the FEI to what Doris recommends $FEI =~ s/350593390/261766835/; $hash->{6} = $FEI; } #print OUT $hash->{1};# . "\n"; print OUT $hash->{2};# . "\n"; print OUT $hash->{3};# . "\n"; print OUT $hash->{4};# . "\n"; print OUT $hash->{5};# . "\n"; print OUT $hash->{6};# . "\n"; print OUT $hash->{7};# . "\n"; print OUT $hash->{8};# . "\n"; print OUT $hash->{9};# . "\n"; #print $hash->{1} . "1
"; print $hash->{2} . "2
"; print $hash->{3} . "3
"; print $hash->{4} . "4
"; print $hash->{5} . "5
"; print $hash->{6} . "6
"; print $hash->{7} . "7
"; print $hash->{8} . "8
"; print $hash->{9} . "9
"; $i=0; $true=0; $hash->{1} = ""; $hash->{2} = ""; $hash->{3} = ""; $hash->{4} = ""; $hash->{5} = ""; $hash->{6} = ""; $hash->{7} = ""; $hash->{8} = ""; $hash->{9} = ""; } elsif ($line =~/TOTALS/){ print OUT $line; } elsif ($line =~/END OF REPORT/){ print OUT $line; } else { $i++ } }else{ print OUT $line } } #end while close OUT; print end_html();