I am trying to parse a CSV file using NodeJS. while I tried these packages:
Fast csv
Ya-csv
I would like to parse the CSV file into header based objects. I was able to accomplish this with fast-csv, but I have "" values in my CSV file that I would like to ignore. I cannot do this with fast-csv, although I am trying to use
{escape:'"'}
I used ya-csv to try to get around this, but no values are written when trying:
var reader = csv.createCsvFileReader('YT5.csv', {columnsFromHeader:true, 'separator': ','});
var writer = new csv.CsvWriter(process.stdout);
reader.addListener('YT5', function(data){
writer.writeRecord(data);
});
I do not get a way out, any help would be great. Thanks.
Edit: I need output in this format ....
{ 'Video ID': '---kAT_ejrw',
'Content Type': 'UGC',
Policy: 'monetize',
'Video Title': 'Battlefield 3 Multiplayer - TDM na Kanałach Nouszahr (#3)',
'Video Duration (sec)': '1232',
Username: 'Indmusic',
Uploader: 'MrKacu13',
'Channel Display Name': 'MrKacu13',
'Channel ID': '9U6il2dwbKwE4SK3-qe35g',
'Claim Type': 'Audio',
'Claim Origin': 'Audio Match',
'Total Views': '11'
}
.
Video ID, , , , (), , Uploader, , , , , , , " ", " ", " ", " ", " YouTube", " ", " ", " RPM", " YouTube", " AdSense", " "?, , , , , ISRC, GRID, UPC, , , ,
, .
, , .