Обсуждение: copy from multi-line text problem
Can I use copy from command for bulk insertion to table with multi-line text fields? In past< with MySQL i do it with configure "," serarated fields, quotes and "|" separated lines. With Postgres it can't parse more-that-1-line text field. Can I import tis file somehow? Thanks, Igor
Igor Velkov wrote:
>
> Can I use copy from command for bulk insertion to table with multi-line
> text fields?
> In past< with MySQL i do it with configure "," serarated fields, quotes
> and "|" separated lines.
> With Postgres it can't parse more-that-1-line text field.
>
> Can I import tis file somehow?
I have a perl script which I use to parse comma-separated files like
this. It is 'sort-of' generic, but you would need to customise it a
little for your situation.
E-mail me if you would like a copy.
Cheers,
Andrew.
--
_____________________________________________________________________
Andrew McMillan, e-mail: Andrew@catalyst.net.nz
Catalyst IT Ltd, PO Box 10-225, Level 22, 105 The Terrace, Wellington
Me: +64 (21) 635 694, Fax: +64 (4) 499 5596, Office: +64 (4) 499 2267
On Mon, 9 Apr 2001, Andrew McMillan wrote:
> > Can I import tis file somehow?
>
> I have a perl script which I use to parse comma-separated files like
> this. It is 'sort-of' generic, but you would need to customise it a
> little for your situation.
DBD::CSV is another option for moving stuff from a comma-separated text
file into Postgres. I use it all the time for this. Gives me more
control over what I am importing in, because I am using SQL to get stuff
out of the text file and using SQL to insert it into Postgres. It may not
be the fastest option, but it's definitely more flexible.
-- Brett
http://www.chapelperilous.net/btfwk/
------------------------------------------------------------------------
All a man needs out of life is a place to sit 'n' spit in the fire.