Re: Newbie question about importing text files... - Mailing list pgsql-general

From Ron Johnson
Subject Re: Newbie question about importing text files...
Date
Msg-id 452B6500.2040703@cox.net
Whole thread Raw
In response to Newbie question about importing text files...  (Jonathan Greenberg <jgreenberg@arc.nasa.gov>)
Responses Re: Newbie question about importing text files...
List pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/09/06 22:43, Jonathan Greenberg wrote:
> So I've been looking at the documentation for COPY, and I'm curious about a
> number of features which do not appear to be included, and whether these
> functions are found someplace else:
>
> 1) How do I skip an arbitrary # of "header" lines (e.g. > 1 header line) to
> begin reading in data?
> 2) Is it possible to screen out lines which begin with a comment character
> (common outputs for csv/txt files from various programs)?
> 3) Is there a way to read in fixed width files?

Both Python & Perl have CSV parsing modules, and can of course deal
with fixed-width data, let you skip comments, commit every N rows,
skip over committed records in can the load crashes, etc, etc, etc.

Probably not what you wanted to read, though, since performance
takes a big hit.  But it definitely works...

- --
Ron Johnson, Jr.
Jefferson LA  USA

Is "common sense" really valid?
For example, it is "common sense" to white-power racists that
whites are superior to blacks, and that those with brown skins
are mud people.
However, that "common sense" is obviously wrong.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFK2UAS9HxQb37XmcRAmOqAJ4um4xLJnKBVQ2LWB1kYYIJyBNHZgCgv/gk
griA2wHFOEogj2WToM5mxpc=
=gn/u
-----END PGP SIGNATURE-----

pgsql-general by date:

Previous
From: Ron Johnson
Date:
Subject: Re: Newbie question about importing text files...
Next
From: Ludwig Kniprath
Date:
Subject: Problem compiling PostGIS 1.1.4