Re: Script for reading flat file without delimiters

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Mehdi Aboulkassim <mehdi10ab(at)yahoo(dot)fr>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Script for reading flat file without delimiters
Date: 2006-06-29 13:36:57
Message-ID: 20060629133657.GA37181@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Greg Stark 2006-06-29 13:47:01 Re: [GENERAL] UUID's as primary keys
Previous Message Tino Wildenhain 2006-06-29 13:25:06 Re: Script for reading flat file without delimiters