更新时间:2023-11-26 22:48:40
在更正后使用示例输入使其成为有效的JSON:
Using your sample input after rectification to make it valid JSON:
jq -r '.list[] | [.given_url] + (.tags|keys_unsorted) | @csv' input.json
产量:
"https://***.com/questions/28164849/using-jq-to-parse-and-display-multiple-fields-in-a-json-serially","fields","jq","multiple"
这是有效的CSV.如果您不希望所有的双引号都可以,请尝试使用字符串插值.
This is valid CSV. If you don't want all the double quotation marks, you can use string interpolation as in your attempt.