Skip to Content

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.

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. Naina R

    Hi sheng<br/><br/>My file is like this <br/><br/>HDD    9800000660980000061911062009AA123456bbWM100012349800000619 <br/>DDD_TEST001 4012YAG1  <br/>WZOA00000000010000000001<br/>WZOA00000000020000000002<br/>IAAXX000001<br/>IAAXX000002<br/>C0000000000000000000100000000000000000001000000000000000000020000000000000000000300000000000000000004<br/>T2<br/><br/>and my structure is<br/><br/>Header – 1<br/>Detail – 0….Unbounded<br/>Bag – 0…..Unbounded (sub node of detail)<br/>Track – 0…..Unbounded (sub node of detail)<br/>Customer – 0…..Unbounded (sub node of detail)<br/>Trailer – 1<br/><br/>and in the file sender adapter i mentioned the following content conversion setting<br/><br/>HEADER,1,DETAIL,,Bag,,Track,,Customer,,TRAILER,*naina


Leave a Reply