Announcement Announcement Module
Collapse
No announcement yet.
How to get line number while using FlatFileItemReader Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to get line number while using FlatFileItemReader

    Hi

    I am using FlatFileItemReader to read a delimited flat file. While reading a particular line as input, I would like to get the corresponding line number in my Mapper class. How shall I do this?

    Request your suggestions.

    Regards
    Chandra

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

    Comment


    • #3
      take a look at the documentation for linemapper, so if you create an own mapper class which implements the linemapper interface you have the linenumber access

      Comment

      Working...
      X