i have a json array where each entry has this structure:
{ inputarray: {[ {"header": "YouTube Music","title": "Watched Nu Nu Meta Phenomena","titleUrl": "https://music.youtube.com/watch?v\u003dtn6jAoVZPZc","subtitles": [{"name": "Machine Girl - Topic","url": "https://www.youtube.com/channel/UCLrbiaonFS1jgtNN44e7R9g" }],"time": "2025-03-22T16:15:20.314Z","products": ["YouTube"],"activityControls": ["YouTube watch history"]},{"header": "YouTube Music","title": "Watched Sick!!!","titleUrl": "https://music.youtube.com/watch?v\u003dwi3i3gEa2aw","subtitles": [{"name": "Machine Girl - Topic","url": "https://www.youtube.com/channel/UCLrbiaonFS1jgtNN44e7R9g" }],"time": "2025-03-22T16:04:58.457Z","products": ["YouTube"],"activityControls": ["YouTube watch history"]},etc. there are about 4000 entries. when i run:
jq '.inputarray[].subtitles[]'i get this error:
jq: error (at .\watch-history.json:42689): Cannot iterate over null (null)that's the end of the file, all of the data has been processed. if i use
jq '.inputarray[].subtitles[]?'then suppresses the error at this stage, but it throws more errors later in the pipeline when doing anything that tries to process the entire array.
i've tried removing the input array key and running it as an array instead of an object with no change. i've tried slurp and stream with no change. this doesn't happen when i use a smaller subset of the file (about 1000 entries seems fine). i'm running jq on a windows machine in pwsh 7, and i've tried inputting the file via jq's native input and also piping it from get-content with no change. i've tried something like jq '.inputarray[0:3000][].subtitles[]' and it will give me the first 3000 entries and then still throw the eof error.