I am trying to read a csv file from 4th row, in my csv file first 3 rows contains some meta data in column1. But the actual number of columns in csv is 6.
eg:
metadata1
metadata2
metadata3
head01,head02,head03,head04,head05,head06
data11,data12,data13,data14,data15,data16
data21,data22,data23,data24,data25,data26
Code I am trying is:
fs.createReadStream('/path/file.csv').pipe(
parse({ from_line: 4, fromLine: 4 }, function(data, err) {
console.log(data);
})
);
I am getting data as undefined. Also If I am removing the args of parse, I am getting error Error: Invalid Record Length: expect 1, got 6 on line 4. Please guide!