cancel
Showing results for 
Search instead for 
Did you mean: 

opencsv in java ignores backslash (\) in a field value

Former Member
0 Kudos

Hi Experts

I am reading a csv file using opencsv.

The csv files is seprated by comma (,) and enclosed in double quotes.

Test.csv file:

ID, Country, ShortName, Quantity

"1", "UK", "Nice\Good", "120"

The problem occurs when reading the values of a column ShortName that has the special character backslash (\), this is stripped out of the value.

The value of ShortName becomes: NiceGood.

How does opencsv (CSVReader) can be able to read the '\' special character?

Your help would be appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

This issue is resolved by using java module.

Answers (2)

Answers (2)

naveen_chichili
Active Contributor
0 Kudos

Hi Dai,

What is the File encoding you have used in you sender channel?

try UTF-16 if still it is not working mark it to "TEXT" instead of "Binary" and try ISSO8859 encoding.

Thanks and Rgegards,

Naveen

former_member207892
Participant
0 Kudos

Hi Ally,

Are you trying to use FCC in sender file channel?

I think if the requirement is to read complex csv file with special character, then you may have to use Java mapping to read the file and convert to xml file before feeding to PI.

try this link for more action on opencsv reader.

http://wiki.sdn.sap.com/wiki/display/NWTech/Java+Mapping+to+Read+Complex+CSV+File

Thanks!

Praveen