From: | "Rudi Starcevic" <rudi(at)oasis(dot)net(dot)au> |
---|---|
To: | "Marcus Andree S(dot) Magalhaes" <marcus(dot)magalhaes(at)vlinfo(dot)com(dot)br>, pgsql-novice(at)postgresql(dot)org |
Subject: | Re: replacing CR/LF |
Date: | 2003-07-12 15:42:44 |
Message-ID: | 20030712154244.M27969@oasis.net.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Hi Marcus,
Yes there is a simple way to fix this.
Many times I've had to export text from windows text files.
Here's how I do it.
After moving the text files onto Linux use this command to
clear up the offending character(s)
cat file.txt | perl -pe 's:\r::g' > file2.txt
Inside file2.txt all the \r have been replaced with nothing.
Lets say now you then need to clean up some pesky $ as well.
Just press the up arrow on your keyboard to bring up the command's
you just executed and edit them a little to look like this:
cat file2.txt | perl -pe 's:\$::g' > file3.txt
As you can see these commands can be handy to clean up all sort's
of characters.
Hope this helps.
Cheers
Rudi.
> Hello, all.
>
> I have some data imported from some windows text files with a couple
> DOS end-of-line characters (CRLF) on it.
>
> Is there any simple way to remove them all, or just replace them
> with a single whitespace character??
>
> thanks.
>
> -------------------------------
> http://www.vlinfo.com.br
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
From | Date | Subject | |
---|---|---|---|
Next Message | Grant Rhodes | 2003-07-12 18:28:28 | Problem with psql interface |
Previous Message | Aarni Ruuhimäki | 2003-07-12 15:20:18 | Re: replacing CR/LF |