How to replace ^M with a Hard Return with "sed"? - shell
This is a discussion on How to replace ^M with a Hard Return with "sed"? - shell ; + Jolly Roger : > In article , > Michael Vilain wrote: > >> cat filename | tr "\r" "\n" > newfilename > > BTW, you can do it without the cat and pipe [...] In the (good?) old days ...
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#11
| |||
| |||
| > In article > Michael Vilain > >> cat filename | tr "\r" "\n" > newfilename > > BTW, you can do it without the cat and pipe [...] In the (good?) old days that used to earn an immediate "useless use of the cat award" on comp.unix.shell. Have they stopped handing those out? -- * Harald Hanche-Olsen - It is undesirable to believe a proposition when there is no ground whatsoever for supposing it is true. -- Bertrand Russell |
|
#12
| |||
| |||
|
Vladimir Usenko >> It's there. > I was saying that "I dunno about it" because I not have access and > not working with MacOS... (I don't clean all newsgroup before sending > answer). I didn't know the newsgroup was dirty! |
|
#13
| |||
| |||
|
Michael Vilain wrote: > You want to replace the carriage return character (ASCII CONTROL-M or > \015) with a new-line (ASCII CONTROL-J or \010). sed doesn't really > handle control characters very will but there's a UNIX shell command > that works better for this (tr--translate characters). So use this > instead: > > cat filename | tr "\r" "\n" > newfilename If you don't want to mess with a newfilename perl -p -i -e 's:\r:\n:g;' filename -- Wes Groleau Heroes, Heritage, and History http://UniGen.us/PGV |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
All times are GMT -4. The time now is 09:29 AM.




Linear Mode