I have a JSON file like this:
{
"download": [0, 0, 0, 0],
"files": [ "file1.txt", "file1.iso", "file2.txt", "file2.iso" ]
}
For each element in files[] ending in .txt I want to set the corresponding element in download[] to 1. How do I do that in JQ? I googled around but don't really understand JQ syntax.