Hello Experts,
I would like to print the 6th field of a string, so:
But my delimiter is "/", not white space, so:
So, now, fields are numbered from 0, not 1? I need then:
However, if I try (first character is white space):
I'm confused: How does awk number fields/columns?
Apologies for such a trivial question.
I would like to print the 6th field of a string, so:
# echo "1 2 3 4 5 6 7 8" | awk '{print $6}'
6
But my delimiter is "/", not white space, so:
# echo "/1/2/3/4/5/6/7/8" | awk -F "/" '{print $6}'
5
So, now, fields are numbered from 0, not 1? I need then:
[root@snail ~]# echo "/1/2/3/4/5/6/7/8" | awk -F "/" '{print $7}'
6
However, if I try (first character is white space):
# echo " 1 2 3 4 5 6 7 8" | awk '{print $6}'
6
I'm confused: How does awk number fields/columns?
Apologies for such a trivial question.