http://www.perlmonks.org?node_id=720229


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

perl -l -0x2B -pe 's/\n//g;s/[XYZ]/;/g' corruptedfile > recoveredfile
where 'X', 'Y', 'Z' are characters to be replaced with record separator ';'