Reputation: 17405
I have to write a spring batch program which should handle excel input.
Is there an itemreader present for excel files.
Special case: What if I am unsure about the input format of the file. It could be any of xlsx or xls and the program should be able to handle both.
Solution I have in my hand: Read excel using poi or jexcel and write into a dat file which could then be processed using FlatFileItemReader.
Upvotes: 0
Views: 3975
Reputation: 5619
Write your own ExcelFileItemReader implementing ResourceAwareItemReaderItemStream interface and use poi/jexcel libraries there.
Don't forget to look at FlatFileItemReader source code.
Upvotes: 1