如何使用JavaScript解析excel文件? [英] How to parse an excel file in JavaScript?

查看:140
本文介绍了如何使用JavaScript解析excel文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写一个使用Excel文件的小型工具,解析内容,然后将数据与其他数据集进行比较。这可以很容易地在JavaScript中完成吗?有没有一个JavaScript库呢?

解决方案

首先如何将文件加载到JavaScript?



此外,Excel是一种专有格式,足够复杂,具有多年开发的服务器端库(例如 Apache POI )还没有设法正确地100%逆向工程这些Microsoft格式。



所以我认为答案是你不能。



更新2: / strong>现在可以在JavaScript中加载文件: https://开发人员.mozilla.org / en-US / docs / DOM / FileReader


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?

解决方案

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.

Update 2: It is now possible to load files in JavaScript: https://developer.mozilla.org/en-US/docs/DOM/FileReader

这篇关于如何使用JavaScript解析excel文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆