in reply to Re: extract lines between same pattern
in thread extract lines between same pattern
Here i can get the data where the end is /SUMMARY. For the column data I want to convert to row data. So that i would have:use FileHandle; $fh = new FileHandle '<input.txt'; $in_body = 0; while (<$fh>) { if ($in_body) { if (m{SUMMARY.*?>}i) { $in_body = 0; } else { ($row1, $row2) = split ; # print "$row1", "\t", "$row2" , "\n"; print; } } elsif (m{/SUMMARY.*?>}i) { $in_body = 1; # print; }
summary col1 col2 col3 .... SUMMARY XXXX SUMMARY YYY
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: extract lines between same pattern
by FloydATC (Deacon) on May 27, 2009 at 12:56 UTC | |
by indieBoy (Initiate) on May 27, 2009 at 13:11 UTC | |
by Anonymous Monk on May 27, 2009 at 13:23 UTC |