I have a csv as such:
this is the first column, this is the 2nd,
firstVal, secondVal
david, baseball
jon, soccer
I want to convert this to:
[{firstVal:david, secondVal:baseball},{firstVal:jon,secondVal:soccer}]
My first row in my csv is metadata (basically just a description of the actual column headers--firstVal and secondVal) that I don't want to be included in the json. I've tried:
csvtojson({noheader: true}).fromFile(csvFilePath)//...
but this doesn't seem to work. How can I do this conversion ignoring the first row?
this is the first column
andthis is the 2nd
your own annotations or the values of the first row? Is the issue that you needfirstVal
andsecondVal
to be treated as the headers despite being in the second row? What output are you actually getting at the moment?