Re: Newbie question about importing text files...

Поиск
Список
Период
Сортировка
От Ron Johnson
Тема Re: Newbie question about importing text files...
Дата
Msg-id 452B6500.2040703@cox.net
обсуждение исходный текст
Ответ на Newbie question about importing text files...  (Jonathan Greenberg <jgreenberg@arc.nasa.gov>)
Ответы Re: Newbie question about importing text files...  (Scott Marlowe <smarlowe@g2switchworks.com>)
Список 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 по дате отправления:

Предыдущее
От: Ron Johnson
Дата:
Сообщение: Re: Newbie question about importing text files...
Следующее
От: Ludwig Kniprath
Дата:
Сообщение: Problem compiling PostGIS 1.1.4