on 06-10-2015 4:42 AM
Hello
I´m configuring MessageTransformBean module to convert a text flat file to XML file.
My flat file has fixed lengths and I´m using keyFieldValue to get the correct structure. The problem is that the header structure has ' ' (4 spaces) value at the keyFieldValue and I´m unable to make it work.
To clarify, this is the header line:
920 | 201505011635 | HEAD | 0001 03 |
^ 4 spaces key field value
I already tried it many ways:
xml.Header.keyFieldValue: (4 spaces)
xml.Header.keyFieldValue: | '0x20''0x20''0x20''0x20' |
I also have xml.fieldContentFormatting = nothing
If I change the source text file to:
and configure the module as:
|
It works perfectly. So my configuration of fields and everything else is correct, the only problem are the spaces. I made some tests trying to use hex code for aaaa testing like '0x61''0x61''0x61''0x61' but hex code doesn´t work anyway. Woking on PI 7.11.
Any ideia?
Thanks
Hi Vitor
The source code for MessageTransformBean will trim the value specified in the position for the key field. As such, white spaces are not allowed as part of a key field value - it does not matter whether you use spaces or hexadecimal.
Is there any other field position in the header line that can be used to uniquely identify the header line? Note that the position for the key field does not need to be at the same position for each structure type. Noticed that part of the header line has the value "HEAD", perhaps you can use this position instead as the key field.
Rgds
Eng Swee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Eng Swee Yeoh
I tried that - using the HEAD value, by configuring my key field name in other position. But doesn´t work.
This module has weird behaviour:
My xml.recordsetStructure = Header,1,MasterShipment,*
I´m testing a file with 1 header and 2 MasterShipment.
My MasterShipment works correctly, not the Header.
If I configure as
xml.recordsetStructure = Header,1,MasterShipment,2
The header works (on original key blank value and also on HEAD value).
The correct in my case should be *.
Any ideia?
Thanks
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.