angular - 如何读取上传的excel文件并以角度转换为json
问题描述
关于如何读取上传的excel文件并以角度转换为json的人可以提供帮助吗?谢谢你。
解决方案
https://www.npmjs.com/package/read-excel-file
使用这个 npm 包。
安装
npm install read-excel-file --save
在 html 中
<input type="file" id="input" />
ts
import readXlsxFile from 'read-excel-file'
const input = document.getElementById('input')
input.addEventListener('change', () => {
readXlsxFile(input.files[0]).then((rows) => {
// `rows` is an array of rows
// each row being an array of cells.
})
})
推荐阅读
- javascript - 为什么此服务器端脚本没有获取电子表格值?
- java - 当pojo在多对一关系中有两个实体同一个表时,如何修复Hibernate“对象引用未保存”
- javascript - 错误:this.detachTracks 不是函数 - Twilio Video React
- selenium - 我如何告诉 Selenium 等到报告准备好下载
- python - 为什么这个正则表达式匹配最后一个组而不是整个字符串?
- python - 如何在二元分类器中标准化模型概率分数?
- serverless-framework - 如何在没有 lambda 的无服务器框架配置(适用于 AWS)中实现重定向(301 代码)模拟
- c# - 对 C# 距离转换器感到困惑
- r - 如何在 R 中使用 ggplot 将回归系数显示为条形图
- c++ - 检测到堆损坏:在正常块 C++ 动态 2D 数组之后