cancel
Showing results for 
Search instead for 
Did you mean: 

SFTP - File Content Conversion in HCI

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Sriprasadsbhat
Active Contributor

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

manoj_khavatkopp
Active Contributor
0 Kudos

Hi Sri,

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

Br,

Manoj

Sriprasadsbhat
Active Contributor

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.

Former Member
0 Kudos

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.

Answers (0)