Win a copy of High Performance Python for Data Analytics this week in the Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Java code to search an excel spreasheet

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an document that has over 500 data numbers in the file. If I search for the these numbers manually it will take too long. I would like to automate this process by, creating a list box that will store the numbers I want to perform the search, and the program will search for these numbers in the Excel document. Has anyone created a Java program to search for items in an Excel spreadsheet? Does this make sense?

Any help is greatly appreciated.

thanks,
Mark
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Careful Mark - you'll get a row for cross posting.

Anyway - as I said in your other post - don't use Java, use VBA.
 
Mark Mitchell
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I apologize for that. I will continue my question in the JSP forum.
 
Mark Mitchell
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have to use JSP. So if there is any way to learn how to search an Excel spreasheet please, instead of using VBA please let me know.
If there is something else I should do, like importing the excel data into notepad, for example, please let me know if this is possible and how to do it.

thanks
 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Though I've never had time to experiment with it I believe that the POI package allows you to manipulate a number of MS's formats, including excel. But I expect it will take a little work to figure out how to do it. I'd google for POI.
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should be able to query an Excel range with JDBC/ODBC bridge. Set up an ODBC pointer to the Excel file, create a named range, treat that range as a table.
 
Mark Mitchell
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have an example of how to query a named range?
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Better yet, do the search inside the Excel file using a VBA module which you call using a Java-ActiveX bridge.

Then use that bridge from a Javabean which you call from a servlet which populates the data you display in the JSP.
That's a proper architecture, separating business logic from display logic.
 
Did you miss me? Did you miss this tiny ad?
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic