in reply to Re: Using output again without printing
in thread Using output again without printing
etc, etc Which is fine, as long as it doesn't read the entire new "clean" file as once since I don't think memory could handle that. But if all I need to do is add local $/ = 'END-OF-DOCUMENT', any clue why it no longer works? Thanks again, and I hope my questions are too simple (just not very good at this).open(OUT, ">/Users/micwood/Desktop/output.txt"); while (<>) { s/\r//g; s/\t//g; s/(<h4>Award\s\#\d+<\/h4>)/\nEND-OF-DOCUMENT\n$1/g; s/(<!-- \/noindex --><\/font>)/\nEND-OF-DOCUMENT\n$1/g; print OUT "$_";} close OUT; my $novalue = '.'; # temp value my $temp = '.'; # temp value my $awardhashref= (); open (IN, "/Users/micwood/Desktop/output.txt"); open(OUT2, ">/Users/micwood/Desktop/output2.csv"); my $allDocs = do { local $/ = 'END-OF-DOCUMENT'; <IN>; }; my $rxExtractDoc = qr {(?xms) (<h4>Award\s\#(\d+)<\/h4>(.*?)END-OF-DOCUMENT) }; while ($allDocs =~ m{$rxExtractDoc}g ) { my %award = (); # award hash $award{'entireaward'}= $1; $award{'A_awardno'}= $2; $award{'entireaward'}=~ s/\n//g; if ($award{'entireaward'} =~ m{Dollars Obligated<\/td><td align= +right>\$([^<]+?)<\/font>}gi){ $award{'B_dollob'} = $1};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Using output again without printing
by micwood (Acolyte) on Aug 01, 2008 at 06:00 UTC |