Getting header row from `csv` event
See original GitHub issueIs there a way to get the header row from a csv
event (without listening to json
, end_parsed
or record_parsed
)? The following does not provide access to header row from csv
event:
/**
csvStr:
a,b,c
1,2,3
4,5,6
7,8,9
*/
const csv=require('csvtojson')
csv()
.fromString(csvStr)
.on('csv',(csvRow)=>{ // this func will be called 3 times
console.log(csvRow) // => [1,2,3] , [4,5,6] , [7,8,9]
})
.on('done',()=>{
//parsing finished
})
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Error getting header row from the CSV file
I am working using DataLoader 45.0.0 to migrate our current SF to FSC. When choosing the CSV file in the "Load Inserts" dialog...
Read more >Use csv-parser to only return file headers
Emitted after the header row is parsed. The first parameter of the event callback is an Array[String] containing the header names. use .on(' ......
Read more >How to add a header to a CSV file in Python?
Initially, create a header in the form of a list, and then add that header to the CSV file using to_csv() method. The...
Read more >Imported CSV not using "use First Row as Headers"
Hi When I use import from CSV file in Excel (version 1808 - Build 10730.20264 - Semi annual Channel) it does not use...
Read more >Assistance with Importing CSV with headers on row 2
We have an integration from peoplesoft where data was emailed in with attachment, in xlsx format, that had the headers on row 2, ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Considering a new
header
event which will be populated whenheader:true
If your pass in noHeader:true in param, csv event will emit the header with first callback
Keyang
Sent from my iPhone