For file content conversion scenarios of XI/PI, the customers often ask: how many records have been sent? For example, sales order, usually we split headers and items data into two text files. It’s not easy to find out ‘how many’. There is no query function for ‘how many’ in XI/PI.
But I can design a file structure, which is more readable:
1. Put header and items data in one text file.
2. First line is total number of the header lines, and first field value is (identified by) ‘a’.
3. Then there is header line, then the items of this header line.
4. The first field value of header line is ‘b’, and the first field value of item line is ‘c’.
5. The last field of header line is total item number.
6. The second field of header and item line is a sequence number, which begins with 1.
Now how to parse the data structure? Firstly, define a data type in IR:
And I’d like to explain the content conversion tab in ID.
There are three substructures in the recordset: total header number (t1), header line (t2), item lines (t3). And t1 only occurs one time in one text file (in the first recordset).
Add parameters for each substructure:
Now I can find out how many headers and items in Message Monitor:
And For a simple version file, which only has two substructures, you should feel comfortable to handle it!
I hope it’s useful for you.