Need help for import of text file - Mailing list pgsql-general

From Andreas
Subject Need help for import of text file
Date
Msg-id 50CCCA44.3050900@gmx.net
Whole thread Raw
Responses Re: Need help for import of text file  (Adrian Klaver <adrian.klaver@gmail.com>)
Re: Need help for import of text file  (Peter Bex <Peter.Bex@xs4all.nl>)
Re: Need help for import of text file  (Sheraz Sharif <sheraz@under-new-management.com>)
List pgsql-general
Hi,

I need to import textfiles that have 5 columns but there is just blanks
as delimitors.
I could use COPY to read them but there is a time column that shows
times as " h:mm.ss,ms" in the morning and "hh:mm.ss,ms" in the afternoon.

Problem here is in the morning the first digit of the hour is shown as a
blank so there are 2 blanks before the time so COPY misstakes this as an
empty column and gets confused.

Can someone point me in the direction of an COPY option I'm not aware
of, or alternativly to some console tool that I can put in the batch
before the import step and replace the 2 blanks with 1 blank.

I use an OpenSuse server so some linux tool would do.


regards
Andreas


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: initdb error
Next
From: Adrian Klaver
Date:
Subject: Re: Need help for import of text file