Open felipecespedes opened 5 years ago
I achieved this by using the preRawData
api.
csv()
.fromFile(path)
.preRawData(str => {
const lines = str.split('\n');
// header is on second line
const trimmedStr = lines.filter((_, idx) => idx > 0).join('\n');
return trimmedStr;
})
preRawData event occurs twice on the file. event that needs to be handled right ?
yeah it seems it's being called twice.
If I print out lines.length
, it looks like this.
lines.length 60
lines.length 1
I would like to request a new parameter
let's say my data look like
So I would use it as
and then I would get
Awesome project btw! Thanks