I have file (More than 1 lack lines)as like this
20 14370 rs6054257 G A 29 PASS NS=3;DP=14;AF=0.5;DB;H2 GT:GQ:DP:HQ 0|0:48:1:51,51
20 17330 . T A 3 q10 NS=3;DP=11;AF=0.017 GT:GQ:DP:HQ 0|0:49:3:58,50
20 1110696 rs6040355 A G,T 67 PASS NS=2;DP=10;AF=0.333,0.667;AA=T;DB GT:GQ:DP:HQ 0|0:21:6:23,27
20 1230237 . T . 47 PASS NS=3;DP=13;AA=T GT:GQ:DP:HQ 0|0:54:7:56,60
20 1234567 GTC G,GTCT 50 PASS NS=3;DP=9;AA=G GT:GQ:DP 0/1:35:4
I need split as sliding window and count "0/0" positions as like this
Pos Count
1-10001 0
2-10002 1
3-10003 0
For counting each 10000 positions I used this cmd
tail -n +11 file |
awk -v n=10000 '/0\/0/{c++} NR%n==0{print c; c=0} END {if (NR%n!=0) print c}'