[英]one json object per line with jq from a large json file
Here is my json file:这是我的 json 文件:
[
{
"name": "1"
},
{
"name": "2"
},
{
"name": "3"
},
{
"name": "4"
}
]
i would like to get all object in a file one by line:我想在一个文件中逐行获取所有 object:
{"name":"1"}
{"name":"2"}
{"name":"3"}
{"name":"4"}
and my file is very big and i'am using the stream option.我的文件很大,我正在使用 stream 选项。
Here is my attempt so far:到目前为止,这是我的尝试:
jq --stream -c '.[]' car.json > result.json
but it gives me:但它给了我:
[0,"name"]
"1"
[1,"name"]
"2"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.