详情介绍
jq是一个轻量级且灵活的命令行JSON处理器。
jq类似于用于JSON数据的sed——你可以使用它来切片、过滤、映射和转换结构化数据,就像sed、awk、grep和朋友们让你玩文本一样简单。
jq是用可移植C编写的,它没有运行时依赖关系。您可以下载一个二进制文件,将其scp到同一类型的远程机器上,并期望它能够工作。
jq可以毫不费力地将您拥有的数据格式转换为您想要的格式,并且执行此操作的程序通常比您预期的更短、更简单。
JQ使用方法
下载适合 Windows 的 jq
为了在 Windows 上使用 jq
,需要先从官方网站或其他可信资源下载适用于 Windows 的可执行文件。通常可以找到 .exe
文件版本。
可以从本站下载或者从官方网站下载jq.exe
选择与系统架构相匹配的压缩包(例如 jq-win64.exe
对于 64 位系统),并将其解压到本地磁盘中的合适位置。
下载的文件名为 jq-windows-amd64.exe 可以修改为 jq.exe,方便调用。
type old.json | jq.exe >> C:\Users\LTH\Desktop>new.json
old.json是你要格式化的文件,new.json是格式化完后的文件。
EZ,搞定了。
配置环境变量以便全局调用
为了让命令提示符能够识别 jq
并允许在整个计算机范围内运行此程序而无需指定完整路径:
- 将解压后的
jq.exe
所处目录添加至系统的 PATH 环境变量中; - 或者直接把
jq.exe
移动到已存在于 PATH 中的一个现有文件夹内,比如C:\Windows\System32\
.
完成以上设置后,在任意 CMD 或 PowerShell 终端窗口输入 jq --version
来验证是否成功加载该软件及其具体版本号。
测试安装
一旦完成了上述步骤,则可以通过打开一个新的命令行会话来测试 jq
是否正常工作。尝试打印帮助信息以确认一切就绪:
jq --help
如果显示了详细的帮助文档说明,则表明 jq
已经被正确安装并且可以在 Windows 上正常使用了。
jq命令行参数
jq --help jq - commandline JSON processor [version 1.7.1] Usage: jq [options] <jq filter> [file...] jq [options] --args <jq filter> [strings...] jq [options] --jsonargs <jq filter> [JSON_TEXTS...] jq is a tool for processing JSON inputs, applying the given filter to its JSON text inputs and producing the filter's results as JSON on standard output. The simplest filter is ., which copies jq's input to its output unmodified except for formatting. For more advanced filters see the jq(1) manpage ("man jq") and/or https://jqlang.github.io/jq/. Example: $ echo '{"foo": 0}' | jq . { "foo": 0 } Command options: -n, --null-input use `null` as the single input value; -R, --raw-input read each line as string instead of JSON; -s, --slurp read all inputs into an array and use it as the single input value; -c, --compact-output compact instead of pretty-printed output; -r, --raw-output output strings without escapes and quotes; --raw-output0 implies -r and output NUL after each output; -j, --join-output implies -r and output without newline after each output; -a, --ascii-output output strings by only ASCII characters using escape sequences; -S, --sort-keys sort keys of each object on output; -C, --color-output colorize JSON output; -M, --monochrome-output disable colored output; --tab use tabs for indentation; --indent n use n spaces for indentation (max 7 spaces); --unbuffered flush output stream after each output; --stream parse the input value in streaming fashion; --stream-errors implies --stream and report parse error as an array; --seq parse input/output as application/json-seq; -f, --from-file file load filter from the file; -L directory search modules from the directory; --arg name value set $name to the string value; --argjson name value set $name to the JSON value; --slurpfile name file set $name to an array of JSON values read from the file; --rawfile name file set $name to string contents of file; --args consume remaining arguments as positional string values; --jsonargs consume remaining arguments as positional JSON values; -e, --exit-status set exit status code based on the output; -b, --binary open input/output streams in binary mode; -V, --version show the version; --build-configuration show jq's build configuration; -h, --help show the help; -- terminates argument processing; Named arguments are also available as $ARGS.named[], while positional arguments are available as $ARGS.positional[].
更新日志
13 December 2023
jq 1.7.1 released. Security (CVE-2023-50246, CVE-2023-50268) and bug fixes. See release notes for details.
7 September 2023
After a five-year hiatus, we've returned with a revitalized GitHub organization and a much-anticipated 1.7 release, thanks to our new admins and maintainers. Check out the download page for installation options and see the release notes for details.
下载地址
人气软件
Wolfram Mathematica 14.2.1 中文正式免费版(附安装教程)
51dedecms模板转码专用工具 v5.6中文绿色版(GBK、UTF8码互转)
Python 3.7 for win32 (Python编程开发工具)官方安装版
Mathworks Matlab R2024b v24.2.0.2712019 中文正式免费版(附安
srvinstw 将exe注册为系统服务的软件
Web程序调用本地exe文件之方法(并传参到CS程序)
Composer.exe windows安装包
MathWorks MATLAB R2023b v23.2.0.2485118 Update 6 x64 中文正
Mathematica 11.0.1 for linux 英文特别版(附注册机+激活方法)
Mathworks Matlab R2022b v9.13.0 U2 中文完美授权版(附激活补丁
相关文章
-
jq.exe 一个轻量级且灵活的命令行JSON处理器 v1.7.1
jq是一个轻量级且灵活的命令行JSON处理器,他可以毫不费力地将您拥有的数据格式转换为您想要的格式,并且执行此操作的程序通常比您预期的更短、更简单...
-
网易y3编辑器 v2.5.3 安装免费版
网易Y3编辑器是一款以行业顶级Messiah引擎为基底的高效游戏创作工具,专为降低游戏开发门槛而设计,编辑器提供超万项免费资源库,涵盖角色、特效、音效等全品类素材,并支...
-
阿里云WEF API调用工具 GUI版本 v1.0 绿色免费版
阿里云WEF API调用工具是一款Web应用防火墙,通过调用阿里云密钥AccessKey ID、AccessKey Secret,然后可以直接控制阿里云WAF,操作便捷,欢迎需要的朋友下载使用...
-
Mathworks Matlab R2024b v24.2.0.2712019 中文正式免费版(附安装教程)
MATLAB R2024b由全球领先的数学计算软件开发商 MathWorks正式发布了,新版R2024b 推出了几项重要更新,帮助从事无线通信系统、控制系统和数字信号处理应用的工程师和研究人...
-
MATLAB Runtime R2024a(24.1) Update 4 中文安装免费版(附教程)
MATLAB Runtime R2024a是一组独立的共享库,支持执行已编译的 MATLAB、Simulink 应用程序或组件,允许电脑在没有安装MATLAB软件的情况下运行编译的 MATLAB 应用程序或组件...
-
MathWorks MATLAB R2024a v24.1.0.253703 x64 LINUX 中文授权安装版
MATLAB R2024a LINUX版是一款强大完整的数学计算分析和编程软件!数百万工程师和科学家都使用它来完成自己的项目过程,具有超强的灵活性,全面适应和满足用户在工作过程中...
下载声明
☉ 解压密码:www.jb51.net 就是本站主域名,希望大家看清楚,[ 分享码的获取方法 ]可以参考这篇文章
☉ 推荐使用 [ 迅雷 ] 下载,使用 [ WinRAR v5 ] 以上版本解压本站软件。
☉ 如果这个软件总是不能下载的请在评论中留言,我们会尽快修复,谢谢!
☉ 下载本站资源,如果服务器暂不能下载请过一段时间重试!或者多试试几个下载地址
☉ 如果遇到什么问题,请评论留言,我们定会解决问题,谢谢大家支持!
☉ 本站提供的一些商业软件是供学习研究之用,如用于商业用途,请购买正版。
☉ 本站提供的jq.exe 一个轻量级且灵活的命令行JSON处理器 v1.7.1资源来源互联网,版权归该下载资源的合法拥有者所有。