Skip to Content
0

SFTP - File Content Conversion in HCI

Jul 13, 2017 at 07:30 AM

279

avatar image
Former Member

Hi,

In HCI, we have standard transformers like XML -> JSON, etc.

My structure after mapping is like this:

Recordset (1...1)

----Header (0...unbounded)

------Line (1...1)

I need to output a flatfile that writes each line in a line in a flatfile.

For example, my data is

<Recordset>

<Header>

<Line> abcdef </Line>

</Header>

<Header>

<Line> fghjkl </Line>

</Header>

</Recordset>

My output file will be:

abcdef

fghjkl

Is this possible using standard HCI functions, or do I have to write a script for this?

Thanks.

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

1 Answer

Best Answer
Sriprasad Shivaram Bhat Jul 13, 2017 at 07:53 AM
1

Hello Raye,

You can use standard XML to CSV converter to achieve the same.

Input Data:

<Recordset>
	<Header>
		<Line>abcdef</Line>
	</Header>
	<Header>
		<Line>fghjkl</Line>
	</Header>
</Recordset>

Convertor Configuration:

Output Data:

abcdef
fghjkl

Regards,

Sriprasad Shivaram Bhat


Show 3 Share
10 |10000 characters needed characters left characters exceeded

Hi Sri,

Is XML to CSV converter capable of handling more then 2 level XML structure or have to go for scripts?

Br,

Manoj

0

Hello Manoj,

Above case it is possible since Header node contains only one line[ Since Line has occurance 1.1 ] .In case of nested XML structure you have to go with script.

Regards,

Sriprasad Shivaram Bhat.

1
Former Member
Sriprasad Shivaram Bhat

Hi Sriprasad,

Thank you for your answer regarding this.

However, will this work if I want to choose two different child nodes with different names?

<Recordset><Header1><Line>abcdef</Line></Header1><Header2><Line>fghjkl</Line></Header2></Recordset>

For this, I want to select Recordset/Header1 and Recordset/Header2.

Also, is it possible for this case too:

<Recordset><Field1> Test </Field1><Header1><Line>abcdef</Line></Header1><Header2><Line>fghjkl</Line></Header2><Field2> Test </Field2></Recordset>

I also want to retrieve Field1, Header1/Line, Header2/Line and Field2?

Thanks.

0