Skip to content

de-beautify arrays (keep them on a single line) #1462

Closed
@digger18

Description

@digger18

I was unable to "de-beautify" arrays after a simple select with jq.

Example Input (less.json):
{"name":"configuration","version":"1.0.0","description":"settings","parameters":{"threshold":[[0.7,0.7],0.7,0.7],"margin":[0,0,0,0],"type":"frame"}}

I want to beautify the json but keep the arrays on a single line without new-lines after each element, as in this example:

jq-win64.exe "." less.json
{
"name": "configuration",
"version": "1.0.0",
"description": "settings",
"parameters": {
"threshold": [
[
0.7,
0.7
],
0.7,
0.7
],
"margin": [
0,
0,
0,
0
],
"type": "frame"
}
}

My intended result will look like:

{
"name": "configuration",
"version": "1.0.0",
"description": "settings",
"parameters": {
"threshold": [[0.7,0.7],0.7,0.7],
"margin": [0,0,0,0],
"type": "frame"
}
}

How can I achieve this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions