Re: Importing CSV File

Поиск
Список
Период
Сортировка
От Rob Sargent
Тема Re: Importing CSV File
Дата
Msg-id 562FA50B.5000903@gmail.com
обсуждение исходный текст
Ответ на Re: Importing CSV File  (Adrian Klaver <adrian.klaver@aklaver.com>)
Ответы Re: Importing CSV File
Список pgsql-general
On 10/27/2015 10:04 AM, Adrian Klaver wrote:
On 10/27/2015 08:44 AM, Jeff Janes wrote:
On Mon, Oct 26, 2015 at 2:45 PM, David Blomstrom
<david.blomstrom@gmail.com <mailto:david.blomstrom@gmail.com>> wrote:

    I tried to import a CSV file into a PostgreSQL table using pgAdmin
    III. I got an error message: "extra data after last column."


    All my spreadsheets have an "end of data" column that has /r/n in
    each cell. When I import a CSV file into a MySQL table, everything
    beyond /r/n is ignored. Is there some way to tell PostgreSQL to stop
    at /r/n?


How does it know when to stop ignoring and start the next record?

I wondered about that also. I did find this:

http://dev.mysql.com/doc/refman/5.7/en/load-data.html

LINES TERMINATED BY


You could write a little awk or perl script to give the PROGRAM option
of copy, but you can't do that within pgAdmin.

Cheers,

Jeff


Whence the csv file?  If it starts out in spreadsheet, can you not export only the columns you want in the database?

Google "postgres import tool" finds several options


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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Importing CSV File
Следующее
От: Melvin Davidson
Дата:
Сообщение: Re: Importing CSV File