Re: Exporting 1 text column from all rows from a table to a file per row?

Поиск
Список
Период
Сортировка
От Thom Brown
Тема Re: Exporting 1 text column from all rows from a table to a file per row?
Дата
Msg-id CAA-aLv5MGWV6e08KnHNPa3zOgOgqgZGq=0gOHwscB5y3efoshA@mail.gmail.com
обсуждение исходный текст
Ответ на Exporting 1 text column from all rows from a table to a file per row?  (Joost Kraaijeveld <J.Kraaijeveld@Askesis.nl>)
Список pgsql-general
On 21 November 2011 19:10, Joost Kraaijeveld <J.Kraaijeveld@askesis.nl> wrote:
> Hi,
>
> Is it possible, and if so how, to export a single column of a table into
> a separate file per row? I have a table with ~21000 rows that have a
> column "body1" containing ASCII text and I want to have 21000 separate
> ASCII files, each containing that column "body1". The name of the file
> does not matter, although it would be nice if they had the extension
> "txt".

Does the data contain newlines?  If not, you can just export it to a
single file then use:

split -l 1 exportedfile.txt

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

В списке pgsql-general по дате отправления:

Предыдущее
От: Joost Kraaijeveld
Дата:
Сообщение: Exporting 1 text column from all rows from a table to a file per row?
Следующее
От: Jason Long
Дата:
Сообщение: Re: Supply Chain Calcs