简体   繁体   English

用JavaScript导入Excel文件

[英]Import Excel file in JavaScript

I have a plunker attached herewith. 我随函附上一个矮子。 http://plnkr.co/edit/RkUCchxd6UghOTclMDFj?p=preview 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. 但是,当我尝试导入Excel文件时,它将导入随机的字母数字值和不相关的数据。

Can you please let me know if there is an easy way out there to import and Excel file (csv and xlsx file )? 您能告诉我是否有简单的方法可以导入和Excel文件(csv和xlsx文件)吗?

I read online and found this document but I am not sure how it is used in JavaScript and HTML. 我在线阅读并找到了此文档,但不确定在JavaScript和HTML中如何使用它。 Can anyone help? 有人可以帮忙吗?

http://psjinx.com/programming/2014/01/04/parsing-excel-workbooks-using-javascript/ 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 您可以使用js-xlsx库使用javascript js-xlsx将excel文件解析为json

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文件(xls / xlsx)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM