在JavaScript中导入Excel文件 [英] Import Excel file in JavaScript

查看:135
本文介绍了在JavaScript中导入Excel文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我附有一名蹲伏者。
http://plnkr.co/edit/RkUCchxd6UghOTclMDFj?p=preview



我可以正确导入文本文件,没有任何错误。但是,当我尝试导入Excel文件时,它会导入随机字母数字值和无关数据。

















$ b

我在网上阅读并找到这份文件,但我不确定它是如何在JavaScript和HTML中使用的。任何人都可以帮忙吗?



http://psjinx.com/programming/2014/01/04/parsing-excel-workbooks-using-javascript/

 < HTML> 


解决方案

您可以使用js-xlsx库来解析excel文件to json using javascript
js-xlsx



自述文件解释了如何使用该库,或者您可以参考以下关于库用法的文章
使用JavaScript解析和读取Excel文件(xls / xlsx)


I have a plunker attached herewith. http://plnkr.co/edit/RkUCchxd6UghOTclMDFj?p=preview

I am able to import a text file properly without any errors. However, when I try to import an Excel file, it imports random alphanumeric values and unrelated data.

Can you please let me know if there is an easy way out there to import and Excel file (csv and xlsx file )?

I read online and found this document but I am not sure how it is used in JavaScript and HTML. Can anyone help?

http://psjinx.com/programming/2014/01/04/parsing-excel-workbooks-using-javascript/

<html>

解决方案

You may use js-xlsx library to parse excel file to json using javascript js-xlsx

the readme file explain how to use the library, or you may refer to the following article which talks about the library usage Parse and Read Excel Files (xls/xlsx) With JavaScript

这篇关于在JavaScript中导入Excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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