Page 1 of 1

xml input

Posted: Wed Jan 12, 2011 12:02 am
by Lovesh_Patni
Hi,

I'm trying to read xml file and write it into text file using
folder stage ->xml input -> transformer->Seq file.
Job finishes successfully but when i try to open the seq file data looks in b elow format

10
,
20
,
80
.I want the output to be like
10,20,80
2nd record
..............
Here is the Input xml file format
<import>
<row>
<a>
10
</a>
<b>
20
</b>
<c>
80
</c>
</row>
</import>

Please let me know what nees to be done to fix this

Posted: Wed Jan 12, 2011 4:03 am
by ray.wurlod
This is a vertical pivot. Search DSXchange for techniques - at least three methods exist for server jobs.

Posted: Wed Jan 12, 2011 4:44 am
by eostic
There may be something else odd going on here also..... seems there might be a CRLF actually in your data. You might want to try using some ereplace functions in a transformer and changing all char(13) and char(10)'s [hex 0D's and hex 0A's] to blanks [char(20)] before writing to your target.

Ernie

Re: xml input

Posted: Wed Jan 12, 2011 8:43 pm
by Lovesh_Patni
Thanks for your quick response.
After making below changes its working now.

When I'm wirting the xml file using xml output stage,i have unchecked the option of generate formatted output and it resulted the file in below format
<import><row><a>10</a><b>20</b><c>30</c></row></import>.

When reading this file using xml input stage I'm getting the output in desired format

10,20,30