in reply to scalable chomping
Read the file line by line using $/ = '+'.
Apply regexps on each line to remove \n and replace record separators
This is onliner as example
where 'X', 'Y', 'Z' are characters to be replaced with record separator ';'perl -l -0x2B -pe 's/\n//g;s/[XYZ]/;/g' corruptedfile > recoveredfile
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: scalable chomping
by TGI (Parson) on Oct 29, 2008 at 17:14 UTC |
In Section
Seekers of Perl Wisdom