Thanks grail !
I see what you mean. It is a bit like using the character I am looking for as FS and count the number of field.
Like:
Code:
awk 'BEGIN {FS="x"} {print $0, NF-1}' file
Except that the split option restricts the move to the field only.
I didn't know that the split option returns the number of array by default.
Thanks again grail !