Results 1 to 3 of 3

Thread: How to get line number while using FlatFileItemReader

  1. #1

    Default 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. #2
    Join Date
    Sep 2011
    Posts
    1

    Default

    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...

  3. #3

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •