Re: Script for reading flat file without delimiters

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Script for reading flat file without delimiters
Дата
Msg-id 20060629133657.GA37181@winnie.fuhr.org
обсуждение исходный текст
Ответ на Script for reading flat file without delimiters  (Mehdi Aboulkassim <mehdi10ab@yahoo.fr>)
Список pgsql-general
On Thu, Jun 29, 2006 at 03:10:03PM +0200, Mehdi Aboulkassim wrote:
>   I have to write a function that takes a flat file name in parameter
> and load a table with the file information.

Does it matter if this function runs on the server side or in the
client?

>   I think that it has to read the file line per line and parse each
> one to retreive each column data.
>
>   There is NO DELIMITERS between fields.

How are field boundaries recognized?  By column position?  By
patterns in the content?  This might be easiest with a language
like Perl, Python, Tcl, etc., whether on the client side or in a
server-side function written in one of those languages (PL/Perl,
PL/Python, PL/Tcl, etc.).  You could do it with SQL but other
languages are more suitable for text parsing.

--
Michael Fuhr

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

Предыдущее
От: Tino Wildenhain
Дата:
Сообщение: Re: Script for reading flat file without delimiters
Следующее
От: lbolognini@gmail.com
Дата:
Сообщение: pg_restore: [archiver] could not open input file