Skip to content

Instantly share code, notes, and snippets.

@bright23
Created November 30, 2016 01:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bright23/9690fc22bab668426a1cd448902902c6 to your computer and use it in GitHub Desktop.
Save bright23/9690fc22bab668426a1cd448902902c6 to your computer and use it in GitHub Desktop.
var Excel = require('exceljs')
var fs = require('fs')
var util = require('util')
var targetExcelPath = "リスト.xlsx"
// ワークブック指定
var workbook = new Excel.Workbook();
// ファイルを読み込み
workbook.xlsx.readFile(targetExcelPath).then(function () {
workbook.eachSheet(function(worksheet, sheetId) {
});
//
for(var i=2;i<=451;i++){
var str = "";
for(var j=1;j<=1;j++){
str += sheet1.getCell(i, j).value + ", ";
}
console.log(str);
// writeFileSync(filename,data) writeFile(filename,data,callback)
fs.writeFile('write.txt', str, function(err){
console.log(err);
})
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment