我有一个 2.37 GB 的 json 文件,包含大约 210 万条记录。我想使用 jq 来遍历文件并每 100000 条记录创建一个新文件。
IE
部分1.json 部分2.json 部分3.json 部分4.json 部分5.json 等
有人用jq做过这个吗?
那么您可以结合使用 jqsplit
来写入这些文件。
$ jq -nc --stream 'fromstream(1|truncate_stream(inputs))' large_file.json |
split -dl 100000 -additional-suffix=.json - part
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1844 次 |
最近记录: |