0
votes

Spring Batch - How can I Split a read line (FlatFileItemReader) into multiple lines while writing using FlatFileItemWriter ?

1

1 Answers

0
votes

I'd say you need an ItemProcessor to convert the object created from the single line (let's call that YourInObject) to a List<YourOutObject>.

However, I don't think Spring Batch supports such a One-To-Many approach out of the box, so my guess is you will have to create a custom ItemWriter<List<YourOutObject>> that delegates the individual objects to FlatFileItemWriter<YourOutObject> (You can find examples of delegating writers in the link below).

Reference: