Page 1 of 1

Error reading CSV File

Posted: Fri Jul 13, 2012 7:10 pm
by BernardinoBMM
Im trying to read a CSV file and upload it to a DB2-400 database, The CVS data is pipe separated and I set the configuration to read CVS task as follow:

Field Delimiter = pipe
Record Delimiter=CRLF
Text Qualifier = none
Encoding =

When GAW read the file it fail with the following error:
Invalid record was found with boundaries '3198, 0, 3199, 0'. Invalid character '"' at line '3.198' and column '57. The field must be enclosed with in '"' characters.

the line where its fails look like this

ok--->20100132754|30|150122|01|PASEO DE LA REPUBLICA|5545|-|01|SAN ANTONIO|-|LOCAL
fail-->20100048885|13|150135|04|FIORI |115|A"|12|CENTRO COMERCIAL

its seam that GAW is especting the " caracter even text qualifier is "none"

Re: Error reading CSV File

Posted: Tue Jan 05, 2016 10:09 am
by david_SD
Bump.

I have the same issue trying to read a "CSV" file, except using a tab delimiter. Some of the data contains double-quote characters, so I expected the tab delimiter and textQualifer=none setting to correctly read the file into a column-based record set.
Code: Select all
<readCSV inputFile="${TheFile}" outputRowSetVariable="RSOut" fieldDelimiter="tab" skipInvalidRecords="false" skipFirstRow="true" recordDelimiter="LF" textQualifier="none" version="1.0" />
When the project reaches the first record with a double quote in it, it blows up.
Code: Select all
1/5/16 7:04:19 AM             ERROR     [9013 - readCSV] D:\Program Files\Linoma Software\GoAnywhere\userdata\tmp\inv_input.txt: Invalid record was found with boundaries '229, 0, 230, 0'. Invalid character '"' at line '229' and column '16. The field must be enclosed with in '"' characters.  
I can't seem to find a way to preserve the data as it is and read it into a columnar record set (i.e. ReadCSV vs. ReadFlatFile). Looking for advice on how to do this.

FWIW, I'm using Director 4.7.0.

Thanks.

Re: Error reading CSV File

Posted: Tue Jan 05, 2016 1:04 pm
by Support_Rick
David,

The parsing routine expects the quotes (double quotes) in pairs when they exist. This can be an issue with data like inches (23") or feet (13'). That entry does cause issues as it doesn't have a matching " to pair with. Even if you have the text qualifier set to none.

Most customers will do a "searchAndReplace" to remove all the (single) double-quotes .. changing them to a space or some character they can go through and replace afterwards ... say an ! or ^ or % .. something that's not expected in pairs. Then, when they are done, they do the "searchAndReplace" to change it back inside their data. (Most just leave it off all together).

Re: Error reading CSV File

Posted: Wed Mar 01, 2017 11:26 am
by msm16c
Rick,

Reviving an old post in the case you may be able to help me. I cam receiving the same error but in my case I am using two quote marks.
Code: Select all
|Lename (pronounced "le-nam"|
In this case, is it the open parenthesis that is causing it to error?

Re: Error reading CSV File

Posted: Thu Mar 09, 2017 8:50 am
by Support_Rick
I don't believe it is ...

Please check your End of Record Markers .. .and make sure you're utilizing the correct one. Sometimes people have it setup for CRLF when there's only a CR, or vice-versa.