Re: [GENERAL] import CSV file to a table

Поиск
Список
Период
Сортировка
От Karl Czajkowski
Тема Re: [GENERAL] import CSV file to a table
Дата
Msg-id 20170308165244.GC12449@moraine.isi.edu
обсуждение исходный текст
Ответ на Re: [GENERAL] import CSV file to a table  (Rob Sargent <robjsargent@gmail.com>)
Ответы Re: [GENERAL] import CSV file to a table  (Rob Sargent <robjsargent@gmail.com>)
Список pgsql-general
On Mar 08, Rob Sargent modulated:

> Yes Karl, I agree.  I admitted as much.  But if it's clean, as in
> free of quoted commas, life is much more simple.  I've lost site of
> whether or not the OP knows his situation w.r.t. to this.  The awk
> line will tell him and for a one-off load this can make a world of
> difference in complexity - two bash lines and a COPY.
>

Maybe I didn't understand your awk? I thought it was counting commas
in lines.  This isn't the same as counting commas in records.

    this,is,record,one
    "this,,","is
    ,,record","two
    ,,,"

this has three commas on each line and definitely is not suitable
for naive CSV handling.


Karl


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

Предыдущее
От: Rob Sargent
Дата:
Сообщение: Re: [GENERAL] Unable to start postgresql
Следующее
От: Bret Stern
Дата:
Сообщение: Re: [GENERAL] import CSV file to a table