【发布时间】:2018-07-23 16:57:16
【问题描述】:
我有这个结构
file.json:
{
"base_price_mw": 249.99,
"best_offer_base_price": 280.06,
"best_offer_nature": 11,
"best_offer_promo_price": 247.35,
"best_offer_shiping_price": 0,
"best_shop_id": 2004,
"best_shop_name": "Stuff",
"cat_id": 69,
"grey_dot": true,
"is_exclusivity": null,
"is_favorite": false,
"is_new": false,
"is_topsales": false,
"manufacturer_id": 58,
"name": "my product name",
"nature_mw": 11,
"note": "0.0000",
"offers_count": 11,
"offers_min_price": 233.21,
"products_ids": 30671,
"promo_price_mw": 249.99,
"status": 1
}
我想用 jq 做成 tsv,但是 jq 说:
jq: error (at <stdin>:1): object ({"products_...) cannot be tsv-formatted, only array
我不明白为什么
我传递的完整命令是:
jq '@tsv' file.json
我尝试了 -c 或 -r 和 -R 选项,但没有成功。我不明白为什么这不起作用 感谢您的帮助
【问题讨论】: