Announcement Announcement Module
Collapse
No announcement yet.
Pivoting Items Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Pivoting Items

    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:

    field1
    field2
    field3

    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?

  • #2
    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.

    Comment


    • #3
      Worked great! Thanks.

      Comment

      Working...
      X