Re: Finding Errors in .csv Input Data - Mailing list pgsql-general

From David Johnston
Subject Re: Finding Errors in .csv Input Data
Date
Msg-id 015a01cbd367$5368cb20$fa3a6160$@yahoo.com
Whole thread Raw
In response to Re: Finding Errors in .csv Input Data  (Rich Shepard <rshepard@appl-ecosys.com>)
Responses Re: Finding Errors in .csv Input Data  (Rich Shepard <rshepard@appl-ecosys.com>)
List pgsql-general
Why does your transformed data repeat the first 5 columns out the original
CSV?
Why do values within a given field end up on different lines (e.g., SIERRA
MANOR, 39.44)?

Basically, your transform output as presented makes no sense to me; I don't
even see how you could import any records into Postgres if they have that
structure.

Why can you not just import the CSV as generated by Access?

Ignoring the repeating "header" and the line-wrapping the following
differences appears:
Missing a null/blank field between "KAIPER, R L" and "SIERRA MANOR"
Missing a null/blank field between "SIERRA MANOR" and "11/15/1948"

Thus everything after "SIERRA MANOR" is off-by-two in column position
(SIERRA MANOR itself of off by 1) which seems to match what you are seeing
during the import.  You can add a "|" in those two locations and the record
should then import.

Repeat for all other records.

David J.

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Rich Shepard
Sent: Wednesday, February 23, 2011 9:11 AM
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Finding Errors in .csv Input Data
   Each of the 80 rows have extra columns, at least one.

   Here are the same two rows from the original .csv export and the
transformation:

68670,724,"",0,,11/27/1948,"D","N","N","","H","C","32031","087","N18","18N",
"E20","20E","07","","","","MD",39.44,119.77,"NV003","M","KAIPER, R
L","","","","SIERRA
MANOR","","",11/15/1948,"D","",,106,,"",106,6.62,0,60,102,1,12.00,,30.00,,,"
B","G","G","AIR COMPRESSOR TESTED 30 GPM ALSO","","3","MEL MEYER","RT 1 BOX
10RENO,",,3,"NV003","JSWINGHOLM",1/16/2003,"",,"F",11/11/1948,,,261013.36,43
69139.23

68670|724||0||11/27/1948|D|N|N||H|C|32031|087|N18|18N|E20|20E|07||||MD|3
68670|724||0||9.44|119.77|NV003|M|KAIPER, R L|||SIERRA
68670|724||0||MANOR||11/15/1948|D|||106|||106|6.62|0|60|102|1|12.00||30.
68670|724||0||00|||B|G|G|AIR COMPRESSOR TESTED 30 GPM ALSO||3|MEL
68670|724||0||MEYER|RT 1 BOX 10
68670|724||0||RENO|||3|NV003|JSWINGHOLM|1/16/2003|||F|11/11/1948|||26101
68670|724||0||3.36|4369139.23

   When I compared the two I saw no difference. Why the latter does not want
to fit the schema I don't know.

   I can send the schema again and the whole 80-row file to anyone willing
to hemp me find the problems.

Rich


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make
changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


pgsql-general by date:

Previous
From: Rich Shepard
Date:
Subject: Re: Finding Errors in .csv Input Data
Next
From: Adrian Klaver
Date:
Subject: Re: Finding Errors in .csv Input Data