Re: CSV Utility

From: Beena J P <beena(dot)jp(at)nic(dot)in>
To: Steve Crawford <scrawford(at)pinpointresearch(dot)com>, Mike angelo <angelocmp(at)yahoo(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: CSV Utility
Date: 2009-08-07 05:12:15
Message-ID: 004401ca171d$a17302c0$3702a20a@Beena
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Command to import data from text file to postgresql table
1. Create table of the same order os text file. Then execute the command at
Query analyser.

copy tablename from textname (with path) CSV
eg: copy friends.office1 from 'C:/FRIENDS/ksebsouth.txt' CSV

regards
Beena
----- Original Message -----
From: "Steve Crawford" <scrawford(at)pinpointresearch(dot)com>
To: "Mike angelo" <angelocmp(at)yahoo(dot)com>
Cc: <pgsql-admin(at)postgresql(dot)org>
Sent: Friday, August 07, 2009 3:10 AM
Subject: Re: [ADMIN] CSV Utility

> Mike angelo wrote:
>> Is there a Postgres utility that allows data contained in a CSV file to
>> be loaded into the database?
>>
> You mean like psql?
>
> \copy tablename from csvfilename CSV
>
> or with a header:
> \copy tablename from csvfilename CSV HEADER
>
> or an alternate delimiter:
> \copy tablename from csvfilename CSV delimiter '|'
>
> or export data (tab-delimited):
> copy foo to stdout CSV DELIMITER E'\t';
>
> Cheers,
> Steve
>
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Frank Broniewski 2009-08-07 09:48:47 Used ports
Previous Message Beena J P 2009-08-07 05:11:46 Re: CSV Utility