Re: using the "copy from" command

From: "Knepper, Michelle" <mknepper(at)intellidot(dot)net>
To: "Karl O(dot) Pinc" <kop(at)meme(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: using the "copy from" command
Date: 2004-03-02 20:53:22
Message-ID: 57E2A340D65EB240B071FEED12F4777B0794DE@merlin.intellidot.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yes, I tried using this: tr -d '\r' < datafile
but it didn't get rid of all the other ascii stuff, of course, since I
only indicated '\r'.

Here's another linux command that I used to convert all of my files to
Unix,
instead of, converting them file by file, via EditPadPro:

find . -name "*.txt" | xargs dos2unix

This converted all the .txt files, within the current directory.

Thanks.

-----Original Message-----
From: Karl O. Pinc [mailto:kop(at)meme(dot)com]
Sent: Tuesday, March 02, 2004 12:44 PM
To: Knepper, Michelle
Subject: Re: [GENERAL] using the "copy from" command

FYI, you can feed the file through sed or tr. The only wierd
thing is specifying a \r in shell. I know that $'\r' will do
it in bash. The commands may have an easier way...

On 2004.03.02 12:11 "Knepper, Michelle" wrote:
> Thanks Joe!
> I converted the text file to Unix, using EditPadPro, to get
> rid of all the Windows characters. Got rid of any \r and end-of-line
> stuff.
> And the copy command worked beautifully. It entered all of the data
> into the table.
>
> Simple thing to do, but new to me.
>
> Ciao. ;-)
>
>
>
> -----Original Message-----
> From: Joe Conway [mailto:mail(at)joeconway(dot)com]
> Sent: Monday, March 01, 2004 2:28 PM
> To: Knepper, Michelle
> Cc: pgsql-general(at)postgresql(dot)org
> Subject: Re: [GENERAL] using the "copy from" command
>
>
> Joe Conway wrote:
> > Knepper, Michelle wrote:
> >> medispan=# copy mmw_ade_com from
> >> '/home/mknepper/medispan/datafiles/mmwadecom.txt' with delimiter
> '|';
> >> ": can't parse "ne 1, pg_atoi: error in "14608
> >
> > Looks like bad data in line 14608. What does that line of your input
>
> > file look like?
>
> Strike that -- it actually is a problem in line 1, isn't it (you cut
> off
>
> the line number in the error message above)? It might be end-of-line
> character problem. Was your input file created or edited on Windows by
>
> chance (i.e. ends in \r\n instead of \n)?
>
> Joe
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

Karl <kop(at)meme(dot)com>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2004-03-02 21:09:05 Re: Moving from MySQL to PGSQL....some questions (multilevel
Previous Message Paulovič Michal 2004-03-02 19:48:06 Re: max table size