• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Java + Excel and Word files

 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all

I have to be able to read in an Excel file, I was wondering what the best approach is? I have read people that use JDBC and some that use POI. For what I saw of POI it was only good for Excel 97-02. I also have to read in a Word file that contains images. Does Java have something that can read Word files in also. One more I might also have to convert a Word file to HTML does Java have a solution for this?

Any thought?

Thanks,

Jutah
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the Jakarta POI supports reading and writing into Word files as well. Go through <a href="http://jakarta.apache.org/poi/">this link</a>
 
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
POI supports Word files, but only in a very basic way (yet). It can extract text from DOC files, but not images.

I'm not aware of any Java library that can convert DOC to HTML. You could try OpenOffice, which can open DOC files, and which has a Java API. Some information about that is linked here.

Update: Looks like I spoke too soon. There's now a 3.0 alpha version which seems to have the necessary classes and methods to extract images from DOC files. Have a look at the getPicturesTable method in HWPFDocument.
[ January 09, 2007: Message edited by: Ulf Dittmer ]
 
Andrew Mcmurray
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys so POI is probably the way to go?

AMD
 
Ulf Dittmer
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. For Excel it works very well. If it doesn't do what you need to do with Word files, look into OO.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you can get the Word file saved in .rtf format it might be easier to manipulate. Since Open Office can read most word files and write XML it may be your best choice - and of course the price is right.

Bill
 
And then the entire population worshiped me like unto a god. Well, me and this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic