Skip site navigation (1) Skip section navigation (2)

Re: create database from text file, to delete columns

From: e-letter <inpost(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: create database from text file, to delete columns
Date: 2008-04-03 12:52:55
Message-ID: 298a6f60804030552h5e2f7824ja180d42e27f8fe62@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
On 02/04/2008, Sean Davis <sdavis2(at)mail(dot)nih(dot)gov> wrote:
> No.  You can easily use python, perl, R, java, or some other language
>  to parse the file and generate the create table statements.  However,
>  if you just need to remove some columns, you do not really need the
>  database at all.  Just use a little script (again, in a scripting
>  language) to remove the columns you like.
>
I'm afraid cannot easily use awk, perl, nor rexx (simply beyond my
comprehension). So I want to return to the database way as the nearest
to a spreadsheet.

I tried importing my csv file using the copy command but nothing
happens. I created a blank database and then issued the command:

COPY databasename FROM '/filename.csv' | STDIN WITH DELIMITER ',' NULL
'0.0E0' CSV

Then I issue the command:

\dl

and there is nothing in the database just two empty columns appear,
ID|Description.

How to resolve please.

In response to

Responses

pgsql-novice by date

Next:From: Sean DavisDate: 2008-04-03 14:32:10
Subject: Re: create database from text file, to delete columns
Previous:From: Sean DavisDate: 2008-04-02 15:02:13
Subject: Re: create database from text file, to delete columns

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group