From: xuan thang <xuanthang117@yahoo.com>
To: pgsql-admin@postgresql.org
Subject: Import from CSV
Date: Mon, 7 Apr 2008 01:32:08 -0700 (PDT)
Message-ID: <988143.4270.qm@web55509.mail.re4.yahoo.com> (raw)
Hi,
I'm using The PostgresSQL Interactive Terminal In PostgresSQL 8.1.4.
When I import a table from csv file by command "copy table from './table.csv' with csv header", DB Engine add a new line sequence (\n) after a new line sequence(\n) in origin data automatically.
Example:
My data in Employee.csv file: (this file is exported by The PostgresSQL Interactive terminal )
ID Name Address
1 John City (one new line sequence here)
Country
2.................................................................................
I use The PostgresSQL Interactive terminal to import this csv file to DB by command:
"\copy Employee from './Employee.csv' with csv header"
After import , I have data in table Employee of Postgres DB.
ID Name Address
1 John City (original new line sequence here)
(a new line sequence added here automaticaly)
Country
2.................................................................................
Please help me to import origin data in csv into table.
Thanks alot!
Xuan Thang.
____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.
http://tc.deals.yahoo.com/tc/blockbuster/text5.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: xuanthang117@yahoo.com
Subject: Re: Import from CSV
In-Reply-To: <988143.4270.qm@web55509.mail.re4.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox