cancel
Showing results for 
Search instead for 
Did you mean: 

File content conversion help

former_member190543
Participant
0 Kudos

Hi,

I have a source flat file (file to proxy) with following format with carriage return at the end of the file.

0003012835

6 New employees

0 Employees left

TRUE

The file will only have 4 lines. (5 with carriage return) and they don't repeat)

and the structure which I created in Data type is:

MT_EMP:

EMP_COUNT:

Record:

Org_Id

No.of.New.Employees

No.of.Employees.left

Successful_upload

I am giving the content conversion as:

Document Name: MT_EMP

Document namespace: http://xxxx

Recordset Name: EMP_COUNT

Record Structure: Record,*

Recordset Sequence: Ascending

Record.fieldFixedLengths: 10,22,23,22,7

Record.fieldNames: Org_Id,No.of.New.Employees,No.of.Employees.left,Successful_upload

Record.endSeparator 'nl'

Record.lastFieldsOptional: YES

And I am getting the xml file as:

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

- <ns:MT_EMP xmlns:ns="http://www.emp_details">

- <EMP_COUNT>

- <Record>

<Org_Id>0003012835</Org_Id>

</Record>

- <Record>

<Org_Id>6 New employ</Org_Id>

</Record>

- <Record>

<Org_Id>0 Employee</Org_Id>

</Record>

- <Record>

<Org_Id>0 TRUE</Org_Id>

</Record>

<Record />

</EMP_COUNT>

</ns:MT_EMP>

Only the first field is getting populated again and again which is "Org_Id" and not getting other fields

but I want the xml like this:

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

- <ns:MT_EMP xmlns:ns="http://www.emp_details">

- <EMP_COUNT>

- <Record>

<Org_Id>0003012835</Org_Id>

<No.of.New.Employees>6 New employees</No.of.New.Employees>

<No.of.Employees.left>0 Employees left</No.of.Employees.left>

<Successful_upload>TRUE</Successful_upload>

<Record />

</EMP_COUNT>

</ns:MT_EMP>

Where is my config doing?

Please help!

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ramesh,

try to not use points (.) in field names.

Fabio

former_member190543
Participant
0 Kudos

Hi Fabio,

I replaced with underscores and still doesn't work.

Thanks.

Former Member
0 Kudos

Hi Ramesh,

what is the occurrence of "Record" and "EMP_COUNT" in message mapping?

Fabio

Edited by: Fabio Boni on Aug 31, 2011 12:33 PM

former_member190543
Participant
0 Kudos

Hi Fabio,

The occurances is 1 both for "Record" and "EMP_COUNT

Former Member
0 Kudos

Hi,

so I think you must use:

Record Structure: Record,1

Fabio

former_member190543
Participant
0 Kudos

No, that didn't work either

former_member190543
Participant
0 Kudos

Any more ideas people?

Thanks.

Former Member
0 Kudos

Hi,

no idea I think...

- maybe the names of fields (from the second to the last) are too long?

- maybe you cannot use "Record" as recordset name?

Fabio

former_member190543
Participant
0 Kudos

MAy be my structure in the data type is incorrect.

How would you define the structure for a simple flat file containing 4 fields each in separate lines? No headers, just the data with carriage return.

0010012345 (say .. employer number)

abc (say.. previous company)

efg (say..present company)

test_success (say ... status)

And what would be your content conversion?

Many thanks.

Former Member
0 Kudos

Hi,

try to go through this:

former_member190543
Participant
0 Kudos

The problem was due to the combination of Content conversion and cache problem.

Answers (3)

Answers (3)

Former Member
0 Kudos

try this:

Record.fieldNames: Org_Id,No.of.New.Employees,No.of.Employees.left,Successful_upload

Record.fieldSeparator 'nl'

Record.lastFieldsOptional: YES

former_member190543
Participant
0 Kudos

Hi Amitsri,

I tried it and now entire fields are displayed, but still only one field name for different values.

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

- <ns:MT_EMP xmlns:ns="http://www.emp_details">

- <EMP_COUNT>

- <Record>

<Org_Id>0003012835</Org_Id>

</Record>

- <Record>

<Org_Id>6 New employees</Org_Id>

</Record>

- <Record>

<Org_Id>0 Employees left</Org_Id>

</Record>

- <Record>

<Org_Id>0 TRUE</Org_Id>

</Record>

<Record />

</EMP_COUNT>

</ns:MT_EMP>

Any more thoughts mate?

Thanks.

Former Member
0 Kudos

Hi Ramesh,

Try update your Record Structure to EMP_COUNT,1,Record,*

Regards,

Jenny

former_member190543
Participant
0 Kudos

Hi Jenny,

I tired that, but it gives error in communication channel

Mandatory parameter 'xml.keyfieldName': no value found

I don't have and don't need key field in my source file.

Any more thoughts?

Thanks.

Former Member
0 Kudos

Hi Ramesh,

Try to give field names in quote which may help:

Record.fieldNames: 'Org_Id','No.of.New.Employees','No.of.Employees.left','Successful_upload'.

Thanks,

RK

former_member190543
Participant
0 Kudos

Hi RK,

Just tried with quotes and I am getting mapping error.

I think the way I use the "nl" or the Recordset Structure is incorrect.

Any more thoughts?

Thanks.