Would like to read 6th line (var=i), 9th line(var=j), 12th line (var=k) then output as first row then increment by 10 lines ( i+10;j+10;k+10) and output as second row , and so on ...
Input.txt
MN
LIST
DETAILS
AAAA BBBB CCCC
123421751116849 119865688385 IDLE
DATE TIME DDDD
150203 161044 123-42-50300-14481
EEEE
111394052866500
DETAILS
AAAA BBBB CCCC
123421825027128 119698116932 IDLE
DATE TIME DDDD
150204 183507 123-42-3200-10793
EEEE
352708042150790
DETAILS
AAAA BBBB CCCC
123421893844511 118675320014 IDLE
DATE TIME DDDD
150204 222245 123-42-50000-1823
EEEE
352663056076930
DETAILS
AAAA BBBB CCCC
Expected Output.txt
AAAA,BBBB,CCCC,DATE,TIME,DDDD,EEEE
123421751116849,119865688385,IDLE,150203,161044,123-42-50300-14481,111394052866500
123421825027128,119698116932,IDLE,150204,183507,123-42-3200-10793,352708042150790
123421893844511,118675320014,IDLE,150204,222245,123-42-50000-1823,352663056076930
I have tried below command and in-complete
awk 'BEGIN { FS" "; OFS=","} { for (i=6;j=9;k=12;i<=NR;j<=NR;k<=NR;i+10;j+10;k+10) print $i,$j,$j }' Input.txt
Looking for your suggestions !!!