[Techtalk] real life kewl text-processing and regexps samples
wanted
Rasjid Wilcox
rasjidw at openminddev.net
Sat Jan 10 13:33:28 EST 2004
On Saturday 10 January 2004 12:19, Brenda Bell wrote:
> A command I use a lot is:
>
> cat dos-file.txt | sed -e '1,$s\^M\\g' >linux-file.txt
>
> But that's because I'm always copying files edited on Windows to
> my Linux box with the wrong format. Note that the ^M is ctrl-M
> which must be entered on the command line as ctrl-V ctrl-M.
Why not just use
$ dos2unix dos-file.txt
or
$ dos2unix -n dos-file.txt linux-file.txt
A bit easier to remember. It is also available on Cygwin, for those of use
that occasionally get stuck wanting to edit and save a Linux file while
working on Windows.
Cheers,
Rasjid.
--
Rasjid Wilcox
Canberra, Australia (UTC +11 hrs)
http://www.openminddev.net
More information about the Techtalk
mailing list