cancel
Showing results for 
Search instead for 
Did you mean: 

Content Conversion in receiver channel

Former Member
0 Kudos

Hi all,

I have a proxy to FTP scenario with no mapping involved.Over proxy communication PI is receiving the data, I am creating the CSV file using content conversion in receiver channel and placing the file at FTP.

The file name is coming in one of the field of the input xml,I am using variable substitution and setting the file name from that particular field value.But as I don't want that node and file name element in my output file content, please guide me what parameters can I set in my content conversion to remove the FileNode from o/p csv file.

The sample input xml is

<MT>

<Record>

<Field1>1</Filed1>

<Field2>2</Filed2>

</Record>

<Record>

<Field1>3</Filed1>

<Field2>4</Filed2>

</Record>

<FileNode>

<FileName>InutFile</FileName>

</FileNode>

</MT>

I want output xml to be like

1,2

3,4

I have followed this blog /people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12 to cut the FileNode, but it gives an error in cc parameters.

In my actual i/p payload,the Record is 0..unbounded and there are 50 sub elements inside Record element.

Please provide your inputs.

Thanks,

Ruchi

Accepted Solutions (1)

Accepted Solutions (1)

former_member854360
Active Contributor
0 Kudos

Hi Ruchi,

Also Add the below parameters.

FileNode.fieldSeparator '0'

FileNode.endSeparator '0'

FileNode.fieldFixedLengths 0

FileNode.fixedLengthTooShortHandling Cut

FileNode.fieldNames FileName

Your problem will be resolved.

Former Member
0 Kudos

The error encountered in channel is "Conversion initialization failed: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found: Parameter 'FileNode.fieldFixedLengths' or 'FileNode.fieldSeparator' is missing "

I have tried putting the FileName element inside Record and using the same parameters, but even then it gave the above error.

and actually I dont want to put the FileName element inside Record Element because the Record will repeat approx 500 times, so the FileName column will repeat 500 times with the same value.want to avoid that, thats why put it outside Record element.

Thanks,

Ruchi

former_member854360
Active Contributor
0 Kudos

Hi Ruchika,

As i mentioned in my earlier reply Please add the below parameter and your problem will be resolved

File name should be outside of record. Your current structure is correct. only add the parameters.

FileNode.fieldSeparator '0'
FileNode.endSeparator '0'
FileNode.fieldFixedLengths 0
FileNode.fixedLengthTooShortHandling Cut
FileNode.fieldNames FileName

Former Member
0 Kudos

Hi Debashish,

Thanks for your quick response.

I have tried these conversion parameters, the file is created at target FTP, but there is an additional zero at the end of the file.

Like output file in excel is looking like this

1 2

3 4

0

in csv

1,2,3,4[]0

Thanks,

Ruchi

former_member854360
Active Contributor
0 Kudos

Put 0 between single quote means '0' instead of only 0 for the below two parameters.

FileNode.fieldSeparator '0'

FileNode.endSeparator '0'

Rest are OKK and it will work.

Former Member
0 Kudos

It worked.Thanks alot Debashish for your quick help.

Ruchi.

former_member854360
Active Contributor
0 Kudos

You are welcome

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Can you help provide error message that you era getting?

Regards,

Anurag

former_member854360
Active Contributor
0 Kudos

Hi Ruchi,

Change your structure like this.

MT>

<Record>

<Field1>1</Filed1>

<Field2>2</Filed2>

</Record>

<Record>

<Field1>3</Filed1>

<Field2>4</Filed2>

</Record>

<FileNode>

<FileName>InutFile</FileName>

</FileNode>

</MT>

Dont put the filenode under Record.

Also Add the below parameters.

FileNode.fieldSeparator '0'

FileNode.endSeparator '0'

FileNode.fieldFixedLengths 0

FileNode.fixedLengthTooShortHandling Cut

FileNode.fieldNames FileName

Now use the same parameter mentioned in the blog .Your problem will be resolved.