[plug] Netscape Default Profile...

Trevor Phillips phillips at central.murdoch.edu.au
Wed Feb 23 15:11:45 WST 2000


Steve Grasso wrote:
> 
> >BTW: Any idea how I use sed to strip out ^M's (artefact of DOS txt files) from
> >a text file? I can do it in Perl, but for a simple altering, am wondering how
> >to do it in sed. It's basically the sed regexp to match ^M that has me
> >stumped...
> 
> It's just a one-liner, IMHO stick with perl:
> 
> perl -p -i.tmp -e 's/^M//g;' filename.txt

Aah. I've never used Perl in this way before. Cool! Easier than a manual while
(<>) loop.

> (where ^M = Ctrl-V Ctrl-M)

Yep. I know that bit. ^_^
Or \r should also do it from memory...

-- 
. Trevor Phillips             -           http://jurai.murdoch.edu.au/ . 
: Web Systems Administrator      -           T.Phillips at murdoch.edu.au : 
| IT Services                       -               Murdoch University | 
 >------------------- Member of the #SAS# & #CFC# --------------------<
| On nights such as this, evil deeds are done. And good deeds, of     /
| course. But mostly evil, on the whole.                             /
 \      -- (Terry Pratchett, Wyrd Sisters)                          /



More information about the plug mailing list