jeudi 29 juillet 2021

Does anyone know how to read a file From Line X to Line Y in nodejs? [duplicate]

Lets say i have a file like

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

Of course this is not the real file, If it was i would have just made an array, the file is a space separated file that is very large about 2,000-10,000 lines, and i want to get chunks of it, starting from line x to line y.

Here each number representing a new line, can you in nodejs(in backend) read a file starting from line lets say 15 and ending at 19. There seems to be no native way to do this, nor any questions asked previously on the subject on stack overflow or github.




Aucun commentaire:

Enregistrer un commentaire