How to rename duplicate lines with awk?
问题 I have a file with 1 million lines and some lines are duplicate. I would like to rename the duplicate lines by appending "variant" + a number. The file is formatted as follows: I am a test line She is beautiful need for speed Nice day today I am a test line stack overflow is fun I am a test line stack overflow is fun I have more sentences I am a test line She is beautiful Speed for need stack overflow is fun Let's stop here Desired results: I am a test line She is beautiful need for speed