[EnterpriseDB Logo] Postgres Plus Forums
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
Importing pipe delimited data  XML
Forum Index » Standard Server
Author Message
Louis_Becker_2

New member

Joined: 21/01/2010 01:18:37
Messages: 2
Offline

Dear All

I need to import data delimited with "|". This is easy enough, but one of the fields contains variable length text (as with most of the other fields) that also contains pipes in the data all contained withing quotation marks. One is able to specify text delimiters when importing CSV files, is there a way to achieve this for my pipe delimited file?. Lines in my files look some thing like this:

34|2009.08.12 08:30:21|12-32-1-1|0x00001213|...lots of fields...|"absdre|default{123|3231|345}"|1|2

I would rather not do a search and replace in the files. Can anyone make a suggestion?

Thanks
Louis
sri_v

Member

Joined: 04/12/2009 07:54:27
Messages: 19
Offline

Hi,

You can try with

copy table1 from 'filename' delimiter '|' CSV quote as '"';

Thanks
Sreelatha
Louis_Becker_2

New member

Joined: 21/01/2010 01:18:37
Messages: 2
Offline

Hi Sreelatha

"copy table1 from 'filename' delimiter '|' CSV quote as '"';" worked for the import.

Thanks
Louis
 
Forum Index » Standard Server
Go to:   
Powered by JForum 2.1.8 © JForum Team