$ jq -c -n -R -r -f Text_processing_1.jq readings.txt [22,590,2] [24,410,0] ... [23,47.3,1] There is one maximal run of lines with flag<=0. The maximal run has length 93 and starts at line 5378 and has start date 2004-09-30.