[Gllug] small Wrinkle

Stig Brautaset stigbrau at start.no
Sun Feb 3 13:32:08 UTC 2002


* Les Till <les_till at cableinet.co.uk> spake thus:
> I've been writing perl scripts that will convert a comma separated data
> base file, extracted from a windows application, into a format that will
> be accepted by postgresql.
>  The problem of converting dos EOL to Linux had crossed my mind and I
> have looked around for dos2linux / dos2unix, couldn't find it in my
> setup so forgot about it.
>  Needed to get a few lines of the dos file for testing purposes so I
> used gedit, copy and paste into a new file. Lo and behold I found that
> all the offending CR's had been removed.
>  So if you want to do dos2linux just use gedit - edit, 'select all' or
> 'copy' and 'paste'. I await for replies like 'Yeah we know'  or 'Emacs
> is betterernat'.
>  -Les

1. Open the file in vi(m), use ":%s/^M//" (the ^M in obtained by C-v C-M)
2. tr
3. sed
4. I swear I had a two small utilities installed called todos and
   tounix or something similar that would do this, but they seem to have
   disappeared. Maybe their function are duplicated in the "tcs"
   package.)

Sorry, could not resist :)

Stig

-- 
brautaset.org
Registered Linux User 107343

``Oh, how I wish `undo' was ported to everyday life.''

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list