[Gllug] small Wrinkle

Sean Burlington SeanBurlington
Sun Feb 3 15:08:05 UTC 2002


On Sunday 03 February 2002 1:32 pm, you wrote:
> * 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.)
>
but why not just get tyhe perl scripts to do it ??

a simple 
tr/\r//

should do it 

-- 

Sean

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




More information about the GLLUG mailing list