Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Admin > Im****t from CS...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 4889 of 5124
Post > Topic >>

Im****t from CSV

by xuanthang117@[EMAIL PROTECTED] (xuan thang) Apr 7, 2008 at 01:32 AM

--0-220511979-1207557128=:4270
Content-Type: text/plain; charset=us-ascii

Hi,
I'm using The PostgresSQL Interactive Terminal In PostgresSQL 8.1.4.
When I im****t 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 ex****ted 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 im****t this csv file to DB
by command:
"\copy Employee from './Employee.csv' with csv header"
After im****t , 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 im****t 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
--0-220511979-1207557128=:4270
Content-Type: text/html; charset=us-ascii

<html><head><style type="text/css"><!-- DIV {margin:0px;}
--></style></head><body><div style="font-family:times new roman, new york,
times, serif;font-size:12pt"><div>Hi,<br>I'm using The PostgresSQL
Interactive Terminal In PostgresSQL 8.1.4.<br>When I im****t 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.<br>Example: <br>My data in Employee.csv file:
(this file is ex****ted by The PostgresSQL Interactive terminal )<br><br>ID
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Name&nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp; 
&nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp; 
&nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  Address<br>1&nbsp;&nbsp; 
&nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  John&nbsp;&nbsp; 
&nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp; 
 &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp; 
&nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  City
(one new line sequence here)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; 
&nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp; 
&nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp; 
&nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp; 
&nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp; 
Country<br>2.................................................................................<br><br>I
use The PostgresSQL Interactive terminal to im****t this csv file to DB by
command:<br>"\copy Employee from './Employee.csv' with csv
header"<br>After im****t , I have data in table Employee of Postgres
DB.<br><br>ID
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Name&nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp; 
&nbsp;&nbsp; 
 &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp; 
&nbsp;&nbsp;  &nbsp;&nbsp;  Address<br>
1&nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp; 
John&nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp; 
&nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp; 
&nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  City (original new
line sequence here)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  &nbsp;&nbsp; 
&nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp; 
&nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp; 
&nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp; 
&nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp; 
&nbsp;&nbsp;  (a new line sequence added here automaticaly)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp; 
&nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp; 
&nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp; 
&nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp;  &nbsp;&nbsp; 
&nbsp;&nbsp;  &nbsp;&nbsp;  Country<br>
2.................................................................................<br><br>Please
help me to im****t origin data in csv into table.<br>Thanks alot!<br>Xuan
Thang.<br>
<br><br></div></div><br>



      <hr size=1>You rock. That's why Blockbuster's offering you <a
href="http://us.rd.yahoo.com/evt=47523/*http://tc.deals.yahoo.com/tc/blockbuster/text5.com">one
month of Blockbuster Total Access</a>, No Cost.</body></html>
--0-220511979-1207557128=:4270--
 




 2 Posts in Topic:
Im****t from CSV
xuanthang117@[EMAIL PROTE  2008-04-07 01:32:08 
Re: Im****t from CSV
phillip.smith@[EMAIL PROT  2008-04-08 14:24:34 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Sun Jul 6 1:03:56 CDT 2008.