Re: create database from text file, to delete columns

From: "Sean Davis" <sdavis2(at)mail(dot)nih(dot)gov>
To: e-letter <inpost(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: create database from text file, to delete columns
Date: 2008-04-03 14:32:10
Message-ID: 264855a00804030732h1be740c8u274861f861c4c4b7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Thu, Apr 3, 2008 at 8:52 AM, e-letter <inpost(at)gmail(dot)com> wrote:
> 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

You will still need to create all the columns for your table first.
Also, I think you'll want to look at the documentation for the copy
command, as what you give above should probably result in an error.

Sean

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message e-letter 2008-04-03 14:43:01 Re: create database from text file, to delete columns
Previous Message e-letter 2008-04-03 12:52:55 Re: create database from text file, to delete columns