Тёмный

How to use read and write streams in node.js for BIG CSV files 

Web Dev Cody
Подписаться 223 тыс.
Просмотров 37 тыс.
50% 1

An overview on how to use a read and write stream in node when you want to read in a very large csv file and process it quickly.
------------
🔔 Newsletter eepurl.com/hnderP
💬 Discord / discord
📁. GitHub github.com/codyseibert/youtube

Опубликовано:

 

8 мар 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 26   
@officialabdulrehman
@officialabdulrehman Год назад
This was very helpful. Thank you
@sameerbharadwaj11
@sameerbharadwaj11 Год назад
Thank You! This helped a lot with writing 20mil records to solr.
@WebDevCody
@WebDevCody Год назад
Oh wow this actually helped? I’m glad 😂
@bipinshukla5222
@bipinshukla5222 Год назад
Awesome explaination
@CarlosHonorioBriones
@CarlosHonorioBriones 2 года назад
nice! This is good to know. Thanks!
@rorycawley
@rorycawley 2 года назад
Great video, thanks
@LarsRyeJeppesen
@LarsRyeJeppesen 10 месяцев назад
Super stuff, thanks. Subbed
@SeibertSwirl
@SeibertSwirl 2 года назад
Good job babe!!!
@YOUdudex
@YOUdudex Год назад
Cool video, thanks subscribed
@lucanthony2209
@lucanthony2209 2 года назад
Hello @vJunkie, Thanks for the great content. CAn you make a video using csv-parser & fs libraries to read & write csv files ?
@user-xw6jr7ue4b
@user-xw6jr7ue4b Год назад
thank u, buddy!
@pranjaldoorwar9743
@pranjaldoorwar9743 2 года назад
This might be helpful to me i am trying to read csv data and insert it into mongodb first before parsing it
@PhuTran-nb7me
@PhuTran-nb7me 2 года назад
Hello Sir, I have a question, much appreciated If you can address my doubt. Do chunks come in sequence, in other words, does the read stream wait for the current chunk to finish the operations before it emit the "data" event to process the next chunk? You have a potentially long running iteration there and more importantly, each chunk is interdependent to each other as the last If statement is used to assign the last incomplete row to "unprocessed" variable for the next chunk to use.
@WebDevCody
@WebDevCody 2 года назад
Yes they should come in order.
@empty8537empty
@empty8537empty 2 года назад
It should be in order..which is taken care by your transport layer..
@martinmingosuarez8690
@martinmingosuarez8690 2 года назад
there is a core module called readline that works with streams to read one line at a time, no need to write the logic yourself, otherwise great explanation and video. Cheers
@veremox
@veremox Год назад
im not an expert but a chunk is not necessarily a line...
@oscarmamani5996
@oscarmamani5996 Год назад
martinmingosuarez8690 thank you for this comment! it help me
@LegendKopper
@LegendKopper 7 месяцев назад
-----The topic "NodeJS streams----> (your head)
@mtuchidev
@mtuchidev Год назад
How do you pass a chunk size ?
@haohong5141
@haohong5141 Год назад
node version?
@himaliamit8698
@himaliamit8698 2 года назад
if you show us the format of the csv file it would have made much more sense.
@majidshah48
@majidshah48 2 года назад
i think opening the file will take time or it might just crash
@boople2snoot
@boople2snoot 2 года назад
them jump cuts
@boople2snoot
@boople2snoot 2 года назад
also no sub, your variable is overWatermark, you're waiting for an event emitter if not overWatermark, the function therefore must return true if it is not over the watermark and var should be named underWatermark. Or it would run if not overWatermark, which is under the watermark, which? shit you just ramble, bye.
@ViktosB
@ViktosB 4 месяца назад
Hi, I really enjoy your videos. One of the most productive publisher on RU-vid. But in that video the name "overWatermark" is highly misleading. I struggled understand the whole structure only because of that naming. This would be better if you use instead "canWrite". canWrite is true when we can write and false when the buffer is full. Then we stop -> !canWrite. const canWrite = writeStream.write(`${i}, `); if (!canWrite) { await new Promise((resolve) => writeStream.once('drain', resolve)); } } I might be wrong of course. Other than that - great job again. Continue watching you content 🙂
Далее
Hardest Backend Node.js Concept to Master
11:20
Просмотров 66 тыс.
Parents' Breakfast Rescue Mission for Laptops
00:28
Каха бизнес-класс
00:48
Просмотров 1,1 млн
Недооцененный котел в Симс 4
00:37
Deep Dive into Blobs, Files, and ArrayBuffers
17:42
Просмотров 34 тыс.
The Story of Next.js
12:13
Просмотров 555 тыс.
Node JS - Writable Streams & Backpressure
15:09
Просмотров 5 тыс.
PROOF JavaScript is a Multi-Threaded language
8:21
Просмотров 269 тыс.
This is why dependency injection is useful
3:56
Просмотров 26 тыс.
tRPC, gRPC, GraphQL or REST: when to use what?
10:46
Просмотров 74 тыс.
What is a REST API?
9:12
Просмотров 1,5 млн
Stop Writing So Many Tests
10:02
Просмотров 84 тыс.
Parents' Breakfast Rescue Mission for Laptops
00:28