Feb 12th, 2013, 09:34 AM
I have a flat file source with format of field1|field2|field3. Rather than writing out a single item for each input, I would like to pivot the input record so that my output file contains:
I understand how to implement an ItemProcessor to transform an Input Item into an Output Item. Can my Output Item be a List? The ItemWriter#write takes a List of items to write. I would now have a List of Lists. Am I going to run into any issues here?
Feb 12th, 2013, 09:42 AM
That depends on your LineAggregator (assuming you want to write a flat file) implementation. That LineAggregator#aggregate(T item) in your case would get a List for each call. If you format that list into a String with line breaks in it causing it to be one line per element in the List...all should be just fine.
Feb 18th, 2013, 09:07 AM