I have a large json file (~10GB) like this
{"id":1, "attributes":{"a": 1}}
{"id":2, "attributes":{"a": 4, "b": 5, "d": 6}}
{"id":2, "attributes":{"a": 4, "b": 5, "c": 6, "d": 5, "e": 1}}
{"id":2, "attributes":{"a": 4, "b": 5, "c": 6, "d": 5, "e": 1, h: "l"}}
I need split this file into multifile with size within a certain range (300-350MB)
I tried using split command line
split -l 5000000 test.json
or
split -b 300MB test.json
Both ways don't work as I expected because each line of json file has different size. If divided by size, the size of each file after splitting can be larger or smaller than the range I want. If divided by line, the last line or first line of the files after the split may be cut off