Renumbering duplicate lines with counter awk
问题 I have duplicate words in csv. And i need to count it in such way: jsmith jsmith kgonzales shouston dgenesy kgonzales jsmith to this: jsmith@email.com jsmith1@email.com kgonzales@email.com shouston@email.com dgenesy@email.com kgonzales1@email.com jsmith2@email.com I have smth like that, but it doesn't work properly for me..or i cant do it enter link description here 回答1: A simple way to do it is maintain an array using the username as the index and increment it each time you read a user, e.g.