Обсуждение: COPY: how to use "," as a delimeter?

Поиск
Список
Период
Сортировка

COPY: how to use "," as a delimeter?

От
Jean-Christian Imbeault
Дата:
I have a CSV file that I would like ti import into pgsql. Unfortunately
the data has been exported in the following format:

"filed1","filed2","field3"

furthemore the data also contains the odd " (quote) and in the CSV file
it has been turned into "".

How can I import this data? I have tried COPY but can't find the right
delimeter to use ...

Thanks,

Jc


Re: COPY: how to use "," as a delimeter?

От
frbn
Дата:
Jean-Christian Imbeault a écrit:
> I have a CSV file that I would like ti import into pgsql. Unfortunately
> the data has been exported in the following format:
>
> "filed1","filed2","field3"
>
> furthemore the data also contains the odd " (quote) and in the CSV file
> it has been turned into "".
>
> How can I import this data? I have tried COPY but can't find the right
> delimeter to use ...


In the last resort, sed is your friend

http://linux.ctyme.com/man/man2377.htm

http://unxutils.sourceforge.net/






Re: COPY: how to use "," as a delimeter?

От
"Henrik Steffen"
Дата:
or write a short perl-script to handle this format


Mit freundlichem Gruß

Henrik Steffen
Geschäftsführer

top concepts Internetmarketing GmbH
Am Steinkamp 7 - D-21684 Stade - Germany
--------------------------------------------------------
http://www.topconcepts.com          Tel. +49 4141 991230
mail: steffen@topconcepts.com       Fax. +49 4141 991233
--------------------------------------------------------
24h-Support Hotline:  +49 1908 34697 (EUR 1.86/Min,topc)
--------------------------------------------------------
Ihr SMS-Gateway: JETZT NEU unter: http://sms.city-map.de
System-Partner gesucht: http://www.franchise.city-map.de
--------------------------------------------------------
Handelsregister: AG Stade HRB 5811 - UstId: DE 213645563
--------------------------------------------------------

----- Original Message -----
From: "frbn" <frbn@efbs-seafrigo.fr>
To: "Jean-Christian Imbeault" <jc@mega-bucks.co.jp>
Cc: "pgsql-general" <pgsql-general@postgresql.org>
Sent: Wednesday, August 07, 2002 10:30 AM
Subject: Re: [GENERAL] COPY: how to use "," as a delimeter?


Jean-Christian Imbeault a écrit:
> I have a CSV file that I would like ti import into pgsql. Unfortunately
> the data has been exported in the following format:
>
> "filed1","filed2","field3"
>
> furthemore the data also contains the odd " (quote) and in the CSV file
> it has been turned into "".
>
> How can I import this data? I have tried COPY but can't find the right
> delimeter to use ...


In the last resort, sed is your friend

http://linux.ctyme.com/man/man2377.htm

http://unxutils.sourceforge.net/






---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org