How to remove carriage return and linefeed in combination from unix file -


i have file in unix in getting carriage return (^m) followed linefeed.there many other newline (enter) within file not followed linefeed.i want remove carriage return (^m) followed linefeed such other newline not followed linefeed not affected .can please suggest command this. in advance.

open file using vi editor, type :%s@$@@g

this remove control-m characters @ end of every line.

or

use below perl syntax

perl -e 's/\r//g' -w -p -i

to view control-m characters, use vi -b


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -