Hi,
I want to print column value based on row number say multiple of 8.
Input file:
line 1 67 34
line 2 45 57
. . .
. . .
line 8 12 46
. . .
. . .
line 16 24 90
. . .
. . .
line 24 49 67
Output
46
90
67
I tried
"for ((i = 1; i<=3; i++))
do
b=$(echo "scale=2;($i*8)"| bc)
awk "NR==$b {print $2}" input file>> output file
done"
But it prints both the columns. I want to print only 2nd column.
Please help