cancel
Showing results for 
Search instead for 
Did you mean: 

To split a multi line xml file into a text file

Former Member
0 Kudos

Hi ,

I have a file structue like this.

<?xml version="1.0" encoding="utf-8" ?>

- <Test>

- <Row>

<Field1>CAL</Field1>

<Field2>$</Field2>

<Field3>PCP006</Field3>

<Field4>20060630</Field4>

</Row>

- <Row>

<Field1>CAL</Field1>

<Field2>$</Field2>

<Field3>PCP006</Field3>

<Field4>20060630</Field4>

</Row>

</Test>

I have converted this multi line xml file into a flat file by using the xmltoplain modulle in my sender communication channel and I got the output li

CAL$PCP00620060630 CAL$PCP00620060630

But I need the output like

CAL$PCP00620060630

CAL$PCP00620060630

how do I mention this newline command ?

Thanks,

Vengal.

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi Balguri,

In case of File Adapter you can use the Content conversion parames as below for u r structure.

Recordset Structure -- Row

Row.fieldNames -- Field1,Field2,Field3,Field4

Row.fieldfixedlengths -- 3,1,6,8(and all the 12 fields)

Row.endSeparator -- 'nl'

Try with these parameters once ignore remaing all other parameters u r specifying for a while.Try to test the same and let me know the proceedings.

Cheers

Veera

>>> Reward points,if it is needful.

Former Member
0 Kudos

Hi ,

Now I have removed the module and used teh file content conversion .

and mentioned all the parameters given by you...

I did not get any file output .

do I need to mention any thing else?

Thanks,

Vengal

Former Member
0 Kudos

Hi Balguri,

What is the communication channel you have configured for Receiver side.is it File adapter or else???

Cheers

Veera

Former Member
0 Kudos

It is the file adapter

Former Member
0 Kudos

Hi,

I tried that but it is not workinfg

See my structure is a simple structure in this format.

<Test>

<Row>field1 field2 filed3 </row><Row>field1 field2 filed3</>....and so on

<Test>

so it contains only one record type having fixed no of fields

In this case I used Plain2XML

and used following parameters

Transform.clss

Transform.contenttype

row.endseperator = 'nl'

xml.addheaderline = 0

xml.conversiontype = simplexml2plain

xml.fieldfixedlengths = 3,1,6,8(and all the 12 fields)

but it is not working ....

how do we mention this end seperator?

Former Member
0 Kudos

Hi

use the field seprator and new line correctly

row.endSeparator= 'nl'

Thanks

sudhir sharma

prateek
Active Contributor
0 Kudos
nisarkhan_n
Active Contributor
0 Kudos

CAL$PCP00620060630 CAL$PCP00620060630

to get result like this

CAL$PCP00620060630

CAL$PCP00620060630

you have cofigured the file receiver adapter right......mentin the end Separator as newline there

row.endSeparator= 'nl'