Identifying the group occurence number of each parsed line

瀏覽次數:24 次
跳到第一則未讀訊息

Steven Lequient

未讀,
2018年7月6日 上午10:27:032018/7/6
收件者:beanio-users
Hi,

Previously, I have been using line numbers and their associated record type to highlight each line of a fixedLength invoice, to make each record (and their fields) more distinguishable.

I am now using groups (with an unlimited amount of nested subgroups), records, and segments, to account for the hierarchy of 
I would like to show each line in an accordion, and by that I mean show every field in a collapseable record, itself shown in a collapseable group (and the same with any parent group, obviously).

The problem is that I have found no way of obtaining the group occurence number of the parsed records, since the output is the entire group type associated with every matching record.
For example, if a certain group has been found 3 consecutive times, I would like to be able to distinguish the appartenance of each line between those three, without having to redo what Beanio already does.

Example of what I would like:

GroupA.1
  Record1
  Record2
  GroupB.1
     Record3
     Record4
  GroupB.2
     Record5
     Record6
GroupA.2
  Record7
  Record8
  GroupB.3
     Record9
     Record10
  GroupB.4
     Record11
     Record12

I already have the full template of the hierarchy, names, positions, labels, depth, subgroups...etc.
I also have an hashmap associating the name of the record type and a list of every line of the invoice being of this type.
The only missing element is a link between the line numbers and each single occurence of the groups they are in.

Could you help me?

You will find attached a test config xml file and a test fixed length file. They are both very simple (maybe too simple), but I think they may help by avoiding you writing test files.
I'm trying to stay as generic as I can, so don't take this config file as a template of what's going to be parsed.

Thank you very much in advance.
SEGMENT.xml
fauxTestSegment.txt
回覆所有人
回覆作者
轉寄
0 則新訊息