Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hi need help on uploading a file and converting it into CSV then import into JTable

 
joseph dela cruz
Ranch Hand
Posts: 38
Chrome Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ive been thinking if i can make an application that when i download an excel file from the internet or office cloud and upload it in my java application the java app will automatically convert it into CSV file and read it through standard IO library
i know there are third party libraries that read excel files and put it right into JTable

my question is what im trying to do really worth the trouble?
is using a third party library with this kind of function good ? if yes what library you recommend ?
also if there is a more conventional way than these please share it
thanks
 
Winston Gutkowski
Bartender
Pie
Posts: 10492
64
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
joseph dela cruz wrote:my question is what im trying to do really worth the trouble?

Only you can answer that. If you have to do it, you have to.

I guess my question to you is: Do you really need to have the Excel data in your Java app, or do you just need to be able to look at it? If the latter, simplest might be to just plug a launcher into your GUI (ie, an icon for the Excel file that actually launches Excel itself when pressed).

is using a third party library with this kind of function good ? if yes what library you recommend ?

Unless you fancy writing your own Excel parser, you really don't have much choice but to use a 3rd party product; and there are only two basic ones that I know of:
Apache POI and OpenOffice/Lucene.

Of the two, the first is likely to be much quicker to learn, since it's focused directly on Excel; the latter will be a small part of a much larger API. You may be able to do more with OpenOffice though - although there are likely to be restrictions with both of them.

There is also JExcelApi; but I've never used it, so I can't tell you how good it is.

The basic problem you have is that you're dealing with a proprietary format that is closely guarded by Microsoft; and basically, they don't want you looking at their stuff without paying them.

Winston
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic