6,918 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
2
votes
3
answers
112
views
Combine JSON to YAML list
In a GitLab pipeline job I have multiple JSON files. I need these JSON files as YAML and I would like to have them in the same YAML file as a list. They do not always have the same keys.
I would like ...
2
votes
1
answer
60
views
Get all objects with attribute that does not have any of the provided substrings
Consider this basic JSON file:
{
"list": [
{
"random": 123,
"fruits": "pineapple"
},
{
"...
qwertz's user avatar
- 14.9k
1
vote
1
answer
138
views
Converting JSON to JSONL without losing original object structure
I have JSON that looks like:
{
"18003432343": {
"04:00:25": {....},
"12:00:25": {....},
},
"18005553332": {
"18:11:25": {....},
...
0
votes
1
answer
105
views
Filtering out JSON properties where keys do not match length
I have JSON that looks like:
{
"18003432343": ....,
"18005553332": ....,
"1-3-2025 10:36:41_08941100 AM": ....,
"1-3-2025 11:36:41_08941100 AM": ....
}
...
0
votes
3
answers
123
views
Convert JSON file to CSV using jq, expanding nested array data in multiple columns
I need to convert a JSON file to CSV in a bash script, this a sample file:
{
"total": 1,
"jobs": [
{
"deviceData": {
"deviceId": "...
1
vote
1
answer
94
views
Selecting parent objects based on nested child properties
I have a JSON document as a result of scanning a DVD. It contains a TitleList array, each entry of which contains a ChapterList array, each entry of which has a Duration object. I want to select a ...
miken32's user avatar
- 42.5k
2
votes
1
answer
104
views
How do I portably parse a JSON file using libjq?
Consider the following code snippet based on libjq.
#include <stdio.h>
#include <stdlib.h>
#include <jq.h>
#include <jv.h>
int main(void) {
jq_state *jq = jq_init();
...
0
votes
1
answer
91
views
How to filter list based on prefix list?
I have a list of hostnames and I want to filter out all hostnames that end in any of a given list of domains.
For example for the hostnames
["host1.exmaple.org", "host2.example.org"...
1
vote
1
answer
91
views
Converting JSON to CSV using jq with header line
I have a task to convert a JSON file to a CSV with a header at the top. The header has to be in a particular order. So the order of the keys in the JSON file will be in different order than the ...
1
vote
0
answers
149
views
Add new element stored in a variable to existing JSON array with jq
I am working on creating an adaptive card dynamically. I have the skeleton on the card in JSON and I want to add entries to it (each entry will be a JSON object inside the "body" of the ...
moys's user avatar
- 8,127
3
votes
3
answers
129
views
Converting a CSV file into a nested JSON file using ./jq
I am hoping I can get an answer on this question. I am using ./jq to convert a CSV file into a file of JSON objects. Each line of the CSV input represents a JSON object. A sample of the CSV input is ...
3
votes
1
answer
144
views
jq command with several tables in the json path
My (huge) input file has many entries , what I want to extract is structured like that:
{
"vulnerabilities": [
{
"parentAlert": {
"...
1
vote
2
answers
66
views
How to exclude the elements from one array that exist in another array by some of their properties using jq?
Assuming two json files:
a.json
[
{
"category": "utils",
"name": "yq"
},
{
"category": "utils",
"name": &...
0
votes
1
answer
69
views
JQ will not deep copy arrays with recursive algorithm
When using this algorithm:
jq -s 'def deepmerge(a;b):
reduce b[] as $item (a;
reduce ($item | keys_unsorted[]) as $key (.;
$item[$key] as $val | ($val | ...
-3
votes
1
answer
161
views
Can `jq` be forced` to take slightly malformed JSON body? [closed]
I like using :!pbpaste | jq to see my JSON objects when reading logs in vim.
But it often throws the following error with the slightest inconvenience in the JSON body.
jq: parse error: Invalid numeric ...