解析 csv 时出现 Paparse 错误
Paparse error on parsing csv
您好,我在我的 express 服务器中使用 papaparse,我正在尝试解析一个 csv 列表,但出现以下错误:
{"data":[],"errors":[],"meta":{"delimiter":",","linebreak":"\n","aborted":false,"truncated":false,"cursor":11,"fields":["my-list.csv"]}}
为什么我会看到这个?
// 1. Declare a GET route
contactRouter.route('/contacts')
.get(function(req, res){
var responseJson = parser;
res.send(responseJson);
console.log(responseJson);
});
// 2. Read the CSV file
var data = "my-list.csv";
var parser = Papa.parse(data, {
header: true,
delimiter: ",",
complete: function(results) {
console.log(results);
}
});
这不是错误。这是 console.log(responseJson);
.
的结果
您好,我在我的 express 服务器中使用 papaparse,我正在尝试解析一个 csv 列表,但出现以下错误:
{"data":[],"errors":[],"meta":{"delimiter":",","linebreak":"\n","aborted":false,"truncated":false,"cursor":11,"fields":["my-list.csv"]}}
为什么我会看到这个?
// 1. Declare a GET route
contactRouter.route('/contacts')
.get(function(req, res){
var responseJson = parser;
res.send(responseJson);
console.log(responseJson);
});
// 2. Read the CSV file
var data = "my-list.csv";
var parser = Papa.parse(data, {
header: true,
delimiter: ",",
complete: function(results) {
console.log(results);
}
});
这不是错误。这是 console.log(responseJson);
.