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.
], or a command-line tool that would allow you to append to the file (while truncating the lastnbytes).seekoperation when reading file, maybe you can seek to end of file minus 2 * size of character and then write]and delete rest of it if needed.