2

I'm using the fast-csv node module to parse a csv and it's parsed successfully but i don't want the title of the fields. The output looks like this

[ 'ID', 'Date', 'Description', 'Amount' ]
ID
desc Description
[ '1', '12/4/30', 'kebab ab  ', '-1900.00' ]

the first row is the title of the fields but want to remove them from the output. How do i do it?`

1 Answer 1

3

Set the headers option to true to have it ignore the first line:

const parser = csv({ headers : true });
Sign up to request clarification or add additional context in comments.

2 Comments

My problem is a little different, there is one line and then comes the header. I tried to set skipLines: 1 and headers: true, but can't make it work. Any ideas?
@GuilhermeSampaio should work, at least a simple example does.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.