Re: How to import CSV file?

Поиск
Список
Период
Сортировка
От Medi Montaseri
Тема Re: How to import CSV file?
Дата
Msg-id 8078a1730708281003n30db4b2eu40f4865672ebab76@mail.gmail.com
обсуждение исходный текст
Ответ на How to import CSV file?  ("Chris Hoover" <revoohc@gmail.com>)
Ответы Re: How to import CSV file?  ("Chris Hoover" <revoohc@gmail.com>)
Список pgsql-admin
This might not be the quickest way, but it is a skill you'll be happy to have gained.

Perl has a class (or module) called CSV.pm, you feed it a file, and it does the rest (parsing it) and gives an array for each row. You can then alter them (however you wish) and write them to a file suitable for pg copy, or just use DBI to insert it into the PG. Which is basically an ETL (Extract, Transform, Load). I know insert is slower, but the point was to show a general way that will always for.

Cheers
Medi Montaseri

On 8/28/07, Chris Hoover <revoohc@gmail.com> wrote:
I need some help importing a csv file.  I have been given a csv file full of data that is delimited by a comma, and the strings are delimited by a single quote.  How do you write the copy statement to use a single quote delimiter?  I have tried several things, but so far, no joy.

Thanks for any help,

Chris

В списке pgsql-admin по дате отправления:

Предыдущее
От: "Medi Montaseri"
Дата:
Сообщение: Re: How to monitor resources on Linux.
Следующее
От: "Chris Hoover"
Дата:
Сообщение: Re: How to import CSV file?