split json file based on number of objects
I have a file that contains objects. The object starts with a { and ends with }. There are other internal brackets { } in some items like chain but they have indentation. The file I have is very large so I could not parse the json file. I want to split the objects into several files. I want a full object in each file (I can not split a single object in the middle between two files. If this happens, I can not parse the file.
How to achieve this? The normal split will not consider keeping full object inside file. I can identify the object by "host" and its start and end by { } at the beginning of a line without indentation. Is there a way to split files based on the number of objects?
评论
?
参与讨论