Re: [GENERAL] Importing CSV File

2015-10-27 Thread Jeff Janes
On Mon, Oct 26, 2015 at 2:45 PM, David Blomstrom wrote: > I tried to import a CSV file into a PostgreSQL table using pgAdmin III. I > got an error message: "extra data after last column." > > > All my spreadsheets have an "end of data" column that has /r/n in each >

Re: [GENERAL] Importing CSV File

2015-10-27 Thread Adrian Klaver
On 10/27/2015 08:44 AM, Jeff Janes wrote: On Mon, Oct 26, 2015 at 2:45 PM, David Blomstrom > wrote: I tried to import a CSV file into a PostgreSQL table using pgAdmin III. I got an error message: "extra data after last

Re: [GENERAL] Importing CSV File

2015-10-27 Thread Rob Sargent
On 10/27/2015 10:04 AM, Adrian Klaver wrote: On 10/27/2015 08:44 AM, Jeff Janes wrote: On Mon, Oct 26, 2015 at 2:45 PM, David Blomstrom > wrote: I tried to import a CSV file into a PostgreSQL table using pgAdmin III. I got an

Re: [GENERAL] Importing CSV File

2015-10-27 Thread Melvin Davidson
The trick is to tell postgres where the data ends with \. >From http://www.postgresql.org/docs/9.3/interactive/sql-copy.html End of data can be represented by a single line containing just backslash-period (\.). An end-of-data marker is not necessary when reading from a file, since the end of

Re: [GENERAL] Importing CSV File

2015-10-27 Thread Adrian Klaver
On 10/27/2015 09:36 AM, Melvin Davidson wrote: The trick is to tell postgres where the data ends with \. That is for all the data. What the OP was referring to was designating where each row in the data ended. From http://www.postgresql.org/docs/9.3/interactive/sql-copy.html End of data

Re: [GENERAL] Importing CSV File

2015-10-27 Thread David G. Johnston
On Tue, Oct 27, 2015 at 12:36 PM, Melvin Davidson 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:

[GENERAL] Importing CSV File

2015-10-26 Thread David Blomstrom
I tried to import a CSV file into a PostgreSQL table using pgAdmin III. I got an error message: "extra data after last column." All my spreadsheets have an "end of data" column that has /r/n in each cell. When I import a CSV file into a MySQL table, everything beyond /r/n is ignored. Is there

Re: [GENERAL] Importing CSV File

2015-10-26 Thread Adrian Klaver
On 10/26/2015 02:45 PM, David Blomstrom wrote: I tried to import a CSV file into a PostgreSQL table using pgAdmin III. I got an error message: "extra data after last column." All my spreadsheets have an "end of data" column that has /r/n in each cell. When I import a CSV file into a MySQL

Re: [GENERAL] Importing CSV File

2015-10-26 Thread Gavin Flower
On 27/10/15 10:45, David Blomstrom wrote: I tried to import a CSV file into a PostgreSQL table using pgAdmin III. I got an error message: "extra data after last column." All my spreadsheets have an "end of data" column that has /r/n in each cell. When I import a CSV file into a MySQL table,

Re: [GENERAL] Importing CSV File

2015-10-26 Thread David Blomstrom
Wow, I must be getting dyxlexic; yes, it is \r\n I guess it would be easy enough to just copy the stuff I want to import into a separate spreadsheet and save it as a CSV. I've done that before with really big spreadsheets, actually. Thanks.

Re: [GENERAL] Importing CSV File

2015-10-26 Thread Adrian Klaver
On 10/26/2015 02:45 PM, David Blomstrom wrote: I tried to import a CSV file into a PostgreSQL table using pgAdmin III. I got an error message: "extra data after last column." All my spreadsheets have an "end of data" column that has /r/n in each cell. When I import a CSV file into a MySQL

Re: [GENERAL] Importing CSV File

2015-10-26 Thread Rajeev Bhatta
You could do it simpler by creating a temp table with all columns in the CSV and then doing either creating another table of the temp table or building a view on top of the table. The decision depends on how frequently you would be importing data from the CSV. If only one time then you are