in reply to One Liner to strip crlf

Try this (untested , but you should get the idea):
perl -i -pe 'last unless s/\r//g' <filename>
Not exactly your spec, but it's moral equivalent.

        "You're only given one little spark of madness. You mustn't lose it."         - Robin Williams

Replies are listed 'Best First'.
Re^2: One Liner to strip crlf
by GotToBTru (Prior) on Sep 04, 2014 at 15:49 UTC

    That empties the file if the first line does not have a carriage return.

    1 Peter 4:10