T
T
Timokins2019-01-14 14:06:19
JavaScript
Timokins, 2019-01-14 14:06:19

How to read file line by line with custom delimiter?

There are large files with several million lines,
line-by-line reading is required, but not with a standard separator,
\r\n
but with a custom one, because the file contains the following pattern:

строка 1: ...................
строка 2: ......РАЗДЕЛИТЕЛЬ
строка 3: ....................РАЗДЕЛИТЕЛЬ

those. data from the first line still continues to the second, and the desired separator can only be found at the end of the next line.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Lynn "Coffee Man", 2019-01-14
@timokins

You can use https://www.npmjs.com/package/streamsearch
It is used in busboy to parse http multipart/form-data, where just the fields are separated by a special delimiter

A
Arseny, 2019-01-14
Matytsyn @ArsenyMatytsyn

Nuuu, regular seasons, why don’t they please them?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question