I have a tabular file with a column that is recurrent example
toto tata AFG
fff ddd AFG
ff hhh AWM
qqq ttt AWM
I would like to have an output like
toto tata AFG 1
fff ddd AFG 1
ff hhh AWM 2
qqq ttt AWM 2
by comparing each line to the next one using the 4th column
Is it possible to do it fast with awk ?
thx for help
1 Answer