Greetings,
I am using beanio + Spring batch in order to read records from the database and write it to a fixed length flat file. One of the fields within the flat file (say, variableData) which is 40 bytes long is composed of different columns starting at different positions, overlapping in nature based upon certain conditions in the databse record.
For example,
Parent Field Name - VariableData (Length = 40; Starting position = 203; End position = 242)
If condition1 = true, then -
Child Field 1 - field1 (Length = 4; Starting position = 203; End position = 206)
Child Field 2 - field2 (Length = 35; Starting position = 207; End position = 241)
Child Field 3 - field3 (Length = 1; Starting position = 242; End position = 242)
If condition2 = true, then -
Child Field 1 - field1 (Length = 6; Starting position = 203; End position = 208)
Child Field 2 - field2 (Length = 31; Starting position = 209; End position = 239)
Child Field 3 - field3 (Length = 1; Starting position = 240; End position = 240)
Child Field 4 - field4 (Length = 2; Starting position = 241; End position = 242)
Note: Condition1 and Condition2 is derived from multiple values in the record
Please advise whether its possible to accomplish this w/ beanio and if yes, how?
Thanks,
Riddhi