Re: Importing CSV File - Mailing list pgsql-general

From David G. Johnston
Subject Re: Importing CSV File
Date
Msg-id CAKFQuwa+NpSt5_f306G2mSTBXXcUd3bLXWzfJP2DJ0V8onujpw@mail.gmail.com
Whole thread Raw
In response to Re: Importing CSV File  (Melvin Davidson <melvin6925@gmail.com>)
List pgsql-general
On Tue, Oct 27, 2015 at 12:36 PM, Melvin Davidson <melvin6925@gmail.com> wrote:

contents of /tmp/junk.data:
-------------------------------------------------------------------
1,'junk1'
2,'junk1'
3,'junk1'

​Good info but I resonably certain the format in question is more like:

--------------------
1,'junk1',\r\n,'blah','blah2'​
2,'junk2',\r\n,'blah'
3,'junk3',\r\n,'blah','blah2','blah3'

​and the OP wants to only import the common columns while ignoring the fact that extra columns exist.

I guess line 4 could read:

4,'junk4','important',\r\n,'blah','blah2'

so that even within the main structure there would be a variable number of columns...

David J.​

pgsql-general by date:

Previous
From: Melvin Davidson
Date:
Subject: Re: Importing CSV File
Next
From: Adrian Klaver
Date:
Subject: Re: Importing CSV File