Need a sed command to replace \r with end of line character

June 6, 2013 at 00:30:21
Specs: Windows XP
how to replace \r with new line character using sed command.

I have a file and each line is ended with \r and i want to replace with new line character so that i can differentiate the records. How to do that


See More: Need a sed command to replace \r with end of line character

Report •

#1
June 6, 2013 at 13:18:27
Is this Windows, Unix or Linux? Do you insist on sed or do you have access to perl or python?


Report •

#2
June 6, 2013 at 19:21:28
I assumed windows, and downloaded "sed for windows" (sourceforge, of course) and got this result from messing around with it:

sed -i {s/\\r/\n/g} filename

(make a backup, the file "filename" will be overwritten).


Report •
Related Solutions


Ask Question