on 02-16-2011 12:35 AM
Hello experts,
I have an issue with reading a csv file which contains newline as a part of one of the fields (within double quotes).
I'm using the file content conversion in sender file adapter with the following
NameA.fieldNames = field1, field2, field3, field4
NameA.fieldSeparator = ,
NameA.processFieldNames = fromConfiguration
NameA.enclosureSign = "
NameA.enclosureSignEscape = ""
NameA.endSeparator = 'nl'
This doesn't work. The sender channel treats the newline within double quotes as a new record and is not reading the file correctly.
I though the NameA.enclosureSign and NameA.enclosureSignEscape parameters would do the trick and ignore text that's between the double quotes?
An I missing some Content conversion cofiguration here? Some parameter that I need to set?
Please help resolve this.
Thanks
Karthik
Hi Karthik,
Can you paste few sample records here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For eg.
1a,1b,1c,1d
2a,2b,2c,2d
3a,"3b has line break
line break herre
and here....and here
some text here",3d
4a,4b,4c,4d
5a,5b,5c,5d
Here...the 3rd record, 2nd field has a line break in it within double quotes. The entire text within quotes is one field.
Hope this explains my scenario.
Thanks
Karthik
Hi Karthik,
NameA.fieldNames = field1, field2, field3, field4
NameA.fieldSeparator = ,
NameA.processFieldNames = fromConfiguration
NameA.enclosureSign = " -> This will work
NameA.enclosureSignEscape = "" -> Remove this
NameA.endSeparator = 'nl'
Remove the entry of : NameA.enclosureSignEscape
Refer:
http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/frameset.htm
Regards,
Aravind
Hi,
I have a scenario similar to this.
ClaimsRecords.fieldNames : CompanyName,Invoice,InvoiceDate....,Location Name,...
ClaimsRecords.fieldSeparator : ,
ClaimsRecords.enclosureSign : "
ClaimsRecords.endSeparator : 'nl'
The sample file will look like this:
XYZ,123,21122011,......,"Delhi
India",312,...
ABC,234,22122011,......,"Bangalore
India",432,....
The new line character comes inside the value of the LocationName field. But the above entries made in FCC will handle this kind of file correctly.
Recheck the FCC entries and even check if the file is coming in correct format.
Regards,
Aravind
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.