cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Sender File Adapter File Contect Conversion - Field Lengths Unknown - How to configure ONLY with endSeparator & RecordType

Former Member
0 Kudos

Hello! All

I have the following File Format and do not have and fieldFixedLengths specified - Can you please help with any inputs on Content Conversion parameters to use to convert XML to Flat File as I need to Identify Header and Detail and ONLY need the whole of the line to be passed  as one string based on the record type:

RecordType Values:

Header -- 111

LineItem -- 222

RecordSet Structure:

Header,1,Detail,*

endSeparator:

"|"

fieldFixedLengths:

Unknown - will vary for every line as seen below

File Sample:

111099900006/20/2013399900000039990000003999010000003999000000000000000|

222425000000042500000004250000000425001000000425425000000042500000004250000000425001000000425|

2224250000000425000000042500000004250010000004254250000000425000000042500000004250010000004254250000000425001000000425|

22242500000004250000000425000000042500100000042542500000004250000000425|

22242500000004250000000425000000042500100000042542|

2224250000000425000000042500000004250010000004254250000000425000000042500000004250010000004254250000000425001000000425000425|

Fields:

I only need to get the Header record Type & the rest of the string or even the whole string is fine - which I can sub-string later in the mapping.

Final XML should looks like:

<Header>

<String1>

111

</String1>

<String2>

099900006/20/2013399900000039990000003999010000003999000000000000000

</String2>

</Header>

<Detail>

<String1>

222

</String1>

<String2>

425000000042500000004250000000425001000000425425000000042500000004250000000425001000000425

</String2>

</Detail>

.

.

.

.

<Detail>

<String1>

222

</String1>

<String2>

2224250000000425000000042500000004250010000004254250000000425000000042500000004250010000004254250000000425001000000425000425

</String2>

</Detail>


Can you please let me know if we can identify the record type without specifying the FiledFixedLenghts - and ONLY going by endSeparator.

Your help is greatly appreciated!!

Thank you,

Ritu

Accepted Solutions (1)

Accepted Solutions (1)

former_member184681
Active Contributor
0 Kudos

Hi Ritu,

I think you can achieve what you need, by doing the following:

1. Use Recordset Structure: Line,*

2. Configure the separator as: Line.endSeparator = "|".

The negative consequence is that you need to differentiate the header and items in the mapping, but I can see no other option to successfully convert the flat file of your structure to XML.

Alternatively, you could ask for including some separator between the key 111/222 and the contents.

Regards,

Greg

Former Member
0 Kudos

Thanks! Greg - WIll try to request the separator betn the Key & the Content.

However, please let me know if you think of any other option.

Thanks,

Ritu

former_member184681
Active Contributor
0 Kudos

Dear Ritu,

The first solution I described will work even without the additional separator. You would only have to differentiate the header and items in the mapping.

The additional separator is only required to simplify the implementation a bit.

Regards,

Greg

Answers (2)

Answers (2)

ambrish_mishra
Active Contributor
0 Kudos

Hi Ritu,

You can try reading the file as a fixed length file.

Header,1, Item,*

Structure as below

   Header

          key

          Detail

   Item

          key

          Detail

KeyFieldName should be key

FCC

Header.fieldFixedLengths                                           3,100
Header.endSeparator                                                  'nl'
Header.keyFieldValue111

I have given 100 as length for Detail but you can take anything (upper limit). You can still idnetify the end of record by '|'

Similarly for Item....

FCC

Item.fieldFixedLengths                                           3,100
Item.endSeparator                                                  'nl'
Item.keyFieldValue111

Hope it helps!

Ambrish

Muniyappan
Active Contributor
0 Kudos
Former Member
0 Kudos

Hi Muniyappan

The link doesnt help in this particular case where string / field Lengths are not known.

Thanks,

Ritu