views:

1088

answers:

4

I am trying to write a small web tool which takes an Excel file, parses the contents and then compares the data with another dataset. Can this be easily done in JavaScript? Is there a JavaScript library which does this?

+4  A: 

How would you load a file into JavaScript in the first place?

In addition, Excel is a proprietary format and complex enough that server side libraries with years in development (such as Apache POI) haven't yet managed to correctly 100% reverse engineer these Microsoft formats.

So I think that the answer is that you can't.

Update: That is in pure JavaScript.

cherouvim
+1  A: 

To do everything in js, you'll have to use ActiveX and probably the office web components as well. Just a suggestion, but you probably don't want to go this route; it'll be inefficient and IE/Win only. You'll be better off with a server based solution.

jvenema
A: 

What type of data are you trying to read from the Excel File? What version of Excel are you using?

I am trying to read off hex values using Office 2007.
vivekian2
A: 

Do you really need an Excel file? Why not use Excel to export the data in CSV or XML and load that?

The Excel file format is very specific to Excel's implementation. If you just need the data, use a file format that just contains the data.

Matthew Marshall
The problem with that solution is it requires manual intervention. The excel has multiple worksheets with a lot of fomulas and there is no easy automated way to convert xls to csv, atleast of which i know. Please do update this if you know of some tool which does this in a simple way.
vivekian2