cancel
Showing results for 
Search instead for 
Did you mean: 

Complex File Content conversion - Reciver

Former Member
0 Kudos

Hi all,

I have to convert a XML to CSV. it shuld be fixedLength. My Structure is as follows

<root>

<NameA>

<Val1>dfjsf </Val1>

<Val2>

<Val21>ajdfjs</Val21>

<Val22>dfsdfsd</Val22>

</Val2>

<Val3>sfsfd</Val3>

</NameA>

<NameB>

<ValA>dfsdfc</ValA>

<ValB>

<ValB1>sfdsaf</ValB1>

<ValB2>sdfsf</ValB2>

</ValB>

<ValC>aedfsad</ValC>

</NameB>

</root>

the problem is i am not able to get the right record structure

i tried with

root,NameA,NameB,Val2

it gives an error

can anyone suggest me how can i do this in Adapter or XSLT Mapping is the best option?

Rgds

Aditya

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

I tried with fieldSeparators and it works fine with that. But the problem is with fieldFixedLength

is it not possible with fieldFixedLength ?

rgds

aditya

Former Member
0 Kudos

hi all,

Thnks for your answers but the problem is still not resolved

to tell you on what the o/p structure i want is as follows:

They shuld be Fixed file o/p

With

Val1 Val21 Val 22 Val3

ValA ValB1 ValB2 ValC

I tried the following record structure

NameA,Val2,NameB,ValB

Parameters

NameA.fieldFixedLengths 10,10

Val2.fieldFixedLengths 10,10

NameB.fieldFixedLengths 10,10

ValB.fieldFixedLengths 10,10

This is not working it gives null pointer exception

Rgds

Aditya

Former Member
0 Kudos

Hi,

It will work for fieldFixedLengths also.

You will configure the parameters like below.

Recordset Structure:NameA,Val2,NameB,ValB

Parameters:

NameA.fieldSeparator :'nl'

Val1.fieldFixedLengths :10

Val3.fieldFixedLengths :10

Val2.fieldSeparator :,

Val21.fieldFixedLengths :10

Val22.fieldFixedLengths :10

NameB.fieldSeparator :'nl'

ValA.fieldFixedLengths :10

ValC.fieldFixedLengths :10

ValB.fieldSeparator :,

ValB1.fieldFixedLengths :10

ValB2.fieldFixedLengths :10

Regards,

Prakasu

former_member192295
Active Contributor
0 Kudos

Hi,

It will work add below statement,

fieldNames

ignoreRecordsetName 'true'

fieldFixedlengths & fieldNames statements both should use for ur requirement. Whenever u specify fieldFixedlengths statement u should use fieldNames statement also else it will throw error message.

Former Member
0 Kudos

Hi The output is as follows

dfjsf ,ajdfjs,dfsdfsd

sfsfd

dfsdfc,sfdsaf,sdfsf

aedfsad

I need it in the following format

dfjsf ajdfjs dfsdfsd sfsfd

dfsdfc sfdsaf sdfsf aedfsad

I have also added the white space

I am starting to beilve that this is not possible may be i can try to add the white space in the XML data and then may be use fieldSeparator

Please advice

Rgds

Aditya

Former Member
0 Kudos

Hi i am not sure that you have got my question rightly i have a problem in reciver channel.. not the sender

The options u gave is for the reciver channel

Rgds

Aditya

Former Member
0 Kudos

not using it.. not working with fieldSeparator

Rgds

Aditya

Former Member
0 Kudos

no no... you just need to specify NameA,NameB and then for put specify your fixed lengths or field separators etc.

But the structure is as above.

hemant_chahal
Contributor
0 Kudos

Hello

Can you please tell what is the output you are expecting in CSV.

Former Member
0 Kudos

Hi,

Can u pls tell me ur data which is coming under Name A node and Name B is same or it is different.

if the data is coming under node Name A and Name B is same then u can change ur target data type and creaste only one data type of NameA and make its occurance to 0-unbounded and ur FCC will be simple.

for example if u have 10 records then ur name A will repeate 10 times in that case no need to have name B.

Refer the below FCC.

Receiver FCC no need of Endseparator

Receiver-

chirag