Npm module “csv-to-array” does not read entire CSV file given as input

…衆ロ難τιáo~ 提交于 2020-03-25 17:56:01

问题


I am trying to read CSV file in JavaScript using npm module csv-to-array into an array. I expect the rows_in_csv array to hold all rows (count > 1000) of CSV. But it holds data for only first 507 rows. This is the issue.

let fs = require('fs');
let cwd = __dirname;
let file_path = cwd.concat("/farsi_localization_data.csv");

require("csv-to-array")({
  file: file_path,
  columns: ["Complete key", "", "English Value", "Hindi Value"]
}, function (err, rows_in_csv) {
  let row_count = rows_in_csv.length;

  console.log(`number of rows in CSV is ${row_count}`);
});

Please tell why this would be happening.

来源:https://stackoverflow.com/questions/60740102/npm-module-csv-to-array-does-not-read-entire-csv-file-given-as-input

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!