Re: Importing complete txt file with column names

Поиск
Список
Период
Сортировка
Искать
От
Josh Jore
Тема
Re: Importing complete txt file with column names
Дата
Msg-id
Pine.BSO.4.44.0207030744500.30576-100000@kitten.greentechnologist.org
Ответ на
Список
Дерево обсуждения
Importing complete txt file with column names robert kraus <rob_kra@yahoo.com>
Re: Importing complete txt file with column names Josh Jore <josh@lavendergreens.org>
This is where you grab your trusty language of choice (scripting most
likely) and write a one-off to take input like:

attr\tattr0\tattr1....
0\t1\t2\t.....

and turn it into

CREATE TABLE ... (
	attr ....?,
	attr0 ....?,
	attr1 ....?
	.....
);
COPY ....
0\t1\t2\t....

This isn't a hard problem but since there are specific thing where the
column types aren't known in advance there isn't any prebuilt tool for
this. Mostly you get to write it yourself. It's short - just do it.


Joshua b. Jore ; http://www.greentechnologist.org

On Tue, 2 Jul 2002, robert kraus wrote:

> hi,
>
> I have multiple huge tab delimited txt files with >500
> columns which I want to import, The name of the
> columns is important, has to be the name of the column
> in the table and is always very long. The copy command
> seems to work only with predefined tables. How do I
> import the tables with column names ?
>
> thank you very much for your answer
> robert



В списке pgsql-novice по дате отправления
От: Andrew McMillan
Дата:
От: Josh Jore
Дата:
FAQ