We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在工作中我们必然会经常与各类文件打交道,今天请大家试试用node.js来进行文件处理。请听题: 1、必须使用node.js完成 2、读取指定文件中的内容并将其输出(文件请见邮件,一同发出) 3、输出模式如下: 文件内容: 计划ID HR分类 437238 技术 436751 技术 …… 输出结果: 计划ID HR分类 437238 技术 436751 技术 …… 4、在原数据的基础上再增加以下行,生成新文件 EmployeeID Yourname
The text was updated successfully, but these errors were encountered:
var fs = require('fs'); var xlsx = require('node-xlsx'); // read var obj = xlsx.parse('innerPlan.xlsx'); var dataObj = obj.worksheets[0].data; var length=dataObj.length for(var i=0;i<dataObj.length;i++){ var str=''; for(var j=0;j<dataObj[i].length;j++){ str += dataObj[i][j].value; str += ' '; } console.log(str); } var myString=[{"value":"HXXXX","formatCode":"General"},{"value":"XXXX","formatCode":"General"}]; dataObj.push(myString); obj.worksheets[0].maxRow+=1; var buffer = xlsx.build(obj); fs.writeFileSync("myFile.xlsx", buffer, "binary");
Sorry, something went wrong.
No branches or pull requests
在工作中我们必然会经常与各类文件打交道,今天请大家试试用node.js来进行文件处理。请听题:
1、必须使用node.js完成
2、读取指定文件中的内容并将其输出(文件请见邮件,一同发出)
3、输出模式如下:
文件内容:
计划ID HR分类
437238 技术
436751 技术
……
输出结果:
计划ID HR分类
437238 技术
436751 技术
……
4、在原数据的基础上再增加以下行,生成新文件
EmployeeID Yourname
The text was updated successfully, but these errors were encountered: