java - Parse multi-section file with Spring Batch -
i'd use spring batch parse following multi-section file.
- the headers listed vertically
- the number of headers changes 1 file next
- there multiple, distinct "begin/end" tokens
- each section (meta, head, data, footer) requires different mappers/tokenizers
any ideas?
start-of-file programname=getdata dateformat=yyyymmdd start-of-fields id name end-of-fields timestarted=tue may 6 16:17:15 edt 2014 start-of-data 0|craig| 1|john| 2|tim| 3|| end-of-data datarecords=4 timefinished=tue may 6 16:49:38 edt 2014 end-of-file
the way write custom itemreader<> parse every section , return custom bean: 1 bean header , 1 bean start-of-fields
section preparation (store data step execution context).
start-of-data
/end-of-data
section: data can parsed custom flatfileitemreader
(custom because need stop on end-of-data
, not on classic eof) using header bean gathered before row mapping.
hope can start.
Comments
Post a Comment