Re: Importing undelimited files (Flat Files or Fixed-Length records)

From: Bill Thoen <bthoen(at)gisnet(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Importing undelimited files (Flat Files or Fixed-Length records)
Date: 2008-06-23 14:13:57
Message-ID: 485FAFA5.1030406@gisnet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Patrick TJ McPhee wrote:
> In article <485AE3AA(dot)3030700(at)gisnet(dot)com>, Bill Thoen <bthoen(at)gisnet(dot)com> wrote:
> % I've got to load some large fixed-legnth ASCII records into PG and I was
> % wondering how this is done. The Copy command looks like it works only
> % with delimited files, and I would hate to have to convert these files to
> % INSERT-type SQL to run them through psql.. Is there a way one can
> % specify a table structure with raw field widths and then just pass it a
> % flat file?
>
> pg_loader is supposed to handle this.
>
> http://pgfoundry.org/projects/pgloader
>
>

Thanks, but as it turned out I also had to skip blank lines, so I wrote
a short sed script and piped the data through that into COPY. That
worked just fine.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Simon Riggs 2008-06-23 14:17:45 Re: Forcibly vacating locks
Previous Message Reece Hart 2008-06-23 02:42:20 Re: partitioned table insert triggers