Results 1 to 8 of 8

Thread: how to read data from excel file using spring batch

  1. #1

    Default how to read data from excel file using spring batch

    Currently we are reading records from csv text file using
    org.springframework.batch.item.file.transform.Deli mitedLineTokenizer.
    Now we are shifting to XLS format from csv format.
    does spring batch having any deafult supporting transformer available to read content from excel file. if not can I have any suggestions.
    Please help.
    Thanks
    Raj.

  2. #2
    Join Date
    Dec 2006
    Posts
    1,061

    Default

    Unfortunately, the farthest Spring Batch goes is supporting Excel generated CSVs.

  3. #3
    Join Date
    Jun 2005
    Posts
    4,231

    Default

    Try here: http://poi.apache.org/? Open office also has some Java APIs.

  4. #4

    Default How to handle the event API of POI/Integration with Spring Batch

    Hi,

    I'm using POI's HSSFListener to read in an Excel file (sort of like SAX for Excel ) and it works fine. Now, I'm trying to figure out a way of integrating this with Spring Batch - I basically don't need the ItemReader /FieldSet stuff at all as I already have the values in their correct format e.g. date, double, string etc

    Now- I'm trying to figure out how to implement this that I can plug it into the batch architecture -but I'm not sure how. The main problem is that the POI events would actually drive the Items - i.e. there are no ItemReader.read() call - but I'd like somehow to use as much of the batch infrastructure as possible.
    One other alternative it to read the entire Excel into memory using POI and let an ItemReader read the stored rows - but that is not a very scalable solution.

    Any ideas welcome.

  5. #5
    Join Date
    Jun 2005
    Posts
    4,231

    Default

    The event-based model isn't a good fit for batch processing, as you already noticed (that's why we use StaX in the XML reader). You would be better off going with the Worksheet/Row API in POI. Incidentally, someone else was asking about this the other day and had some code to contribute, so we might see something in the framework soon.

  6. #6
    Join Date
    May 2010
    Posts
    7

    Default how to read data from excel file using spring batch

    Is reading of excel sheet feature included now in spring batch?

  7. #7

    Default

    Quote Originally Posted by Parths View Post
    Is reading of excel sheet feature included now in spring batch?
    No. CSV is supported but not Excel native worksheets.

  8. #8
    Join Date
    May 2010
    Posts
    7

    Default

    Thanks jmoore.

Posting Permissions

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