How to Read/Parse CSV File in Nodejs

preview_player
Показать описание
In this video you will learn how to read or parse csv file in nodejs.
I will use the csv-parser module to read data from csv files.
Рекомендации по теме
Комментарии
Автор

Why when I console.log the array outside it tells me that it's empty ?

bylyone
Автор

how can i read multiple files and store all this csv files data in to one array ??

princepatoliya
Автор

You just copy-paste the example from their npm

igordespot
Автор

If I put the console.log(results); in the line 11, it will show [ ](empty array). It seems that the data is not stored in the results. Is there a way to solve this?

yuguo
Автор

output is coming but db object id only show
please tell how to csv file read and inserted mongodb in date type and number type

chandrurangan
Автор

I was wondering, when I followed your instructions the returned values are right, however some headers are considered as values as they were contained inside a single quote. On my csv, there are 3 columns (Name, Status, Email).

Sample returned data:
{
'Name': 'JP Mangalindan',
'Status': '2nd',
Email: 'null'
}

If you could see, Name & Status were inside the single quotes which made me unable to call the values of Name & Status.

jhoncarlignoro
Автор

how i can acess/use data outside of 'on' ?

gregoryvieira
Автор

How do i notify as error if input is longer than 25 characters?

rafaelcarvalho
Автор

It says I am missing some modules and requires stack. Not sure what I am doing wrong or how to fix this

rachelgraham-tohue
Автор

Does anyone know how to put all the parsed data into a variable?

mikami_teru
Автор

what about savin this into a mongo db collection?

Array_of_objects
Автор

Thanks a bunch bro, it was good for me.

genilsonaraujo
Автор

Such a simple and such a useful! thanks!

ofir
Автор

should I run the NPM install in the same folder as the js file? Is this required? Thank you.

allansarion