Error reading CSV File

Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
5 posts Page 1 of 1

BernardinoBMM

Posts: 2
Joined: Fri Jul 13, 2012 9:32 am

Post by BernardinoBMM » Fri Jul 13, 2012 7:10 pm
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"

david_SD

Posts: 4
Joined: Thu Sep 11, 2014 9:28 am

Post by david_SD » Tue Jan 05, 2016 10:09 am
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.

Support_Rick

Support Specialist
Posts: 590
Joined: Tue Jul 17, 2012 2:12 pm
Location: Phoenix, AZ

Post by Support_Rick » Tue Jan 05, 2016 1:04 pm
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).
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696

msm16c

Posts: 5
Joined: Mon Dec 12, 2016 10:53 am

Post by msm16c » Wed Mar 01, 2017 11:26 am
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?

Support_Rick

Support Specialist
Posts: 590
Joined: Tue Jul 17, 2012 2:12 pm
Location: Phoenix, AZ

Post by Support_Rick » Thu Mar 09, 2017 8:50 am
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.
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
5 posts Page 1 of 1