I have a large file (about 500 megabytes) and the data in it is in JSON format.
{
"0001": [
"aaaaa",
"qqqqq"
],
"0002": [
"aaaaa"
],
"0003": [
"ccccc"
],
"0004": [
"bbbbb"
]
...
}
I need to extract from it:
aaaaa
qqqqq
At the moment and I do the following jq -r 'try . "0001" | .[]' ./1.txt, it works, but the problem is that it takes a very long time because the search continues on through the whole file, instead of stopping immediately after the first match.
Please advise me a way to stop further scouting if an input has already been found. I know that there is a first(inputs | ), but I don't understand how to implements this command.