My tool appends little json blocks with comma at their end into a txt file which initially has [
as the first character, in order to create a whole JSON format text file, like below,
{data: text1},
and txt file seems like at the end of the day,
[{data: text1},{data: text2},{data: text3},
So I have to remove last comma at the end of the text and put a ]
to make it valid JSON right, but this file size is around 1.5GB so I couldn’t figure how to edit it in NodeJS in order to make it valid JSON file.
2
Answers
Additional solution for updating large-sized files with
Transform
as you wanted but working slower than Milos's code for my specific situation,