cancel
Showing results for 
Search instead for 
Did you mean: 

Variable substitution for csv file

madhusudana_reddy2
Contributor
0 Kudos

Hi Guys,

I am using Multimapping to generate 2 target messages and finally creating these 2 messges as csv files. But i need to use variable substitution (because dynamic configuration doesnt work in multimapping) to create the target files and i need to omit this node from content. i know if it is fixed length file we can use variable substitution and finally we can cut the variable in content conversion by using below method

fixedLengthToodShortHandling cut

Note:- I am using PI7.1

thanks,

madhu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi, Madhu

To omit only one node, use :

node.fieldFixedLengths --> 0,0,...0

node.fixedLengthTooShortHandling --> Cut

node.endSeparator --> '0'

Regards,

Carme

madhusudana_reddy2
Contributor
0 Kudos

Hi alentorn,

But i want to create csv file at target and i want to use variable substituion. Finally i want to omit this variable from content.

I think your approach is for fixed length file. Pls confirm.

thanks,

madhu

Former Member
0 Kudos

Hi,

I have similar scenarios, with content conversion and field separator in all other nodes of the target file.

I use variable substitution but this variables are all in the same node with this configuration.

The other nodes have FieldSeparator parameters.

Regards,

Carme

madhusudana_reddy2
Contributor
0 Kudos

Hi alentorn

assume below is my target payload

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

<ns0:MT_MadhuMulti xmlns:ns0="http://rr.unilever.com/bconepi13">

<Strutcture>

<Name>Syam</Name>

<Sex>FEMALE</Sex>

<ID>123</ID>

<Filename>EmpDetails</EmpDetails>

</Strutcture>

<Strutcture>

<Name>Syam1</Name>

<Sex>Male</Sex>

<ID>789</ID>

<Filename>EmpDetails</EmpDetails>

</Strutcture>

</ns0:MT_MadhuMulti>

i want file name as EmpDetails.txt

and file content as below

Syam,Female,123

Syam1,Male,789

Can you tell me my content conversion parametersv in receiver channel???

thanks,

Madhu

Former Member
0 Kudos

You must separate variable filename from the other fields in several nodes.

.

Please, analyze if you can change your scenario, with next stucture:

<ns0:MT_MadhuMulti xmlns:ns0="http://rr.unilever.com/bconepi13">

<Strutcture>

<Name>Syam</Name>

<Sex>FEMALE</Sex>

<ID>123</ID>

</Strutcture>

</Strutcture>

<Strutcture>

<Name>Syam1</Name>

<Sex>Male</Sex>

<ID>789</ID>

</Strutcture>

<nothing>

...

<Filename>EmpDetails</EmpDetails>

</nothing>

</ns0:MT_MadhuMulti>

And then in your CC:

Recordset strucutre --> Structure,nothing

Structure.fieldSeparator --> ;

nothing.fieldFixedLengths --> 0

nothing.fixedLengthTooShortHandling --> Cut

nothing.endSeparator --> '0'

Regards,

Carme.

madhusudana_reddy2
Contributor
0 Kudos

Hi carme alentorn

solved my problem, given u full points.

thanks,

madhu

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Madhu,

Can you change the structure as mentioned in this blog. She mentioned exactly the same issue you have:

/people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12

Regards,

---Satish

VijayKonam
Active Contributor
0 Kudos

If we are on the same page, this might help you - /people/shabarish.vijayakumar/blog/2010/01/14/file-conversion-using-nodeception

VJ