json - 使用 jq 将 JSON 转换为纯文本
问题描述
假设我收到以下 json 响应:
{
"author": "tomek",
"title": "helloworld",
"test": "sampletextonetwothree"
}
是否可以显示如下内容:(使用 jq)
author=tomek
title=helloworld
test=sampletextonetwothree
解决方案
jq 'to_entries[] | "\(.key)=\(.value)"'
应该这样做
推荐阅读
- kubernetes - 如何解析守护程序集中的每个 pod?
- python - 使用 Pytorch 进行低精度二进制分类
- javascript - 无法从谷歌日历获取事件数据
- php - 我可以只使用标签 src 和 alt 来提供 WebP 文件而不是使用
- python - 从具有多个对象的 Json 创建数据框
- linux - 可以关闭两个本地进程之间的 TCP 连接而不涉及任何一个进程吗?
- kotlin - ViewHolder中的协程?[科特林]
- ios - 图像未加载到集合视图单元格中
- rust - move 发生是因为 value 的类型为 Vec
,它没有实现 `Copy` 特征 - c++ - 在字符串中查找前缀