perl -ple" s[\cL][\n]g" < file > modified
Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algoritm, algorithm on the code side." - tachyon
| [reply] [d/l] |
Thanks for that. The c in "\cL" was the bit (no pun intended) that I didn't know about! Once you gave me that information all of my previous attempts to resolve this now work.
Cheers,
Ronnie
| [reply] |
BrowserUK's idea would probably suffice. Another way would be to set the INPUT_RECORD_SEPARATOR variable ($/) to "\xC", which would allow you to read one "page" at a time into $_, instead of just one text line at a time. Then you could split the page record into lines, if that's what you need:
{
local $/ = "\x0C"; # form-feed character (^L)
while (<>) { # $_ contains one whole "page"
@lines = split /\n/; # split into lines if you need to
...
}
}
# $/ is now back to its "normal" setting
| [reply] [d/l] |