我一直在研究一个在读取csv时输出xml的项目,我使用fs.createReadStream()
方法读取csv文件,但是一段时间之后,终端崩溃了。
然后我得到
C:\Users\username\Documents\Programming\Node Projects\DAE Parser\main.js:13
row["Value"].includes("tri") ||
^
TypeError: Cannot read property 'includes' of undefined
它不会读取整个文件。
这是我在做什么
fs.createReadStream("test.csv")
.pipe(csv())
.on("data",row => {
if (
row["Value"].includes("tri") ||
row["Value"].includes("vt") ||
row["Value"].includes("vx") ||
row["Value"].includes("vn")
) {
console.log(row)
}
})