Skip to Content
0

CSV to XML Conversion File Content Conversion

Dec 08, 2016 at 09:43 AM

106

avatar image
Former Member

Hello All,

I'm doing CSV to XML Content conversion in File Sender channel. In the following sample data, I expect data in 3 lines but it is split in 6 lines. Meaning each line is split into 2 line. Need a way to ignore the line feed in the first line so that I can get only 3 XML nodes. With my current configuration I'm still getting 3 XML nodes but the second line data alue3, textvalue4 is being truncated always for all nodes

. Your help is highly appreciated.

My Key Field Name is SET.

Sample Data:

SET,GMESS01,2600001,1288S00,01TEI20262,text1,textv
alue3,textvalue41
SET,GMESS02,2600002,2288S00,01TEI20262,text1,textv
alue3,textvalue4
SET,GMESS03,2600003,3288S00,01TEI20262,text1,textv
alue3,textvalue4

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

6 Answers

avatar image
Former Member Dec 08, 2016 at 10:17 AM
0

Hello Sudha,

Please post the FCC parameters used and XML formed.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Dec 08, 2016 at 10:21 AM
0

Plain2XML. fieldSeparator ,

Plain2XML.keyFieldName SET

As I mentioned the XML is well formed but with truncated 2nd lines

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Dec 08, 2016 at 01:39 PM
0

use Plain2XML.endSeparator

Share
10 |10000 characters needed characters left characters exceeded
Evgeniy Kolmakov Dec 09, 2016 at 03:38 AM
0

Hi Sudha!

I doubt PI's ability to process such file correctly using FCC. Actually you should ask the sender party to remove the line breaks within one line when generating the source file.

Regards, Evgeniy.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Dec 09, 2016 at 06:27 AM
0

@Evgeniy,

Yes. PI capabilities are very limited for such cases. From the source, the sender party is actually entering multiple lines within Excel row. Remember Alt+Enter. and sending this file as csv. Hence the actual single line data is being split with a line feed. The endField 'nl' separator recognizes this as newLine and hence its skipping the other part.

Hope SAP comes up with a solution this. To handle newLine in data field of a CSV file.

Share
10 |10000 characters needed characters left characters exceeded
Evgeniy Kolmakov Dec 09, 2016 at 06:52 AM
0

Hi Sudha!

You always have a possibility to develop custom adapter module to convert your file in needed format before processing it with FCC or even transform it to XML with java code. But I consider it to be a sender side problem.

Regards, Evgeniy.

Share
10 |10000 characters needed characters left characters exceeded