I have a file that has values like:
location 100 SlotNumber ..some lines inbetween location 150 SlotNumber ..some lines inbetween location 160 SlotNumber ..some lines inbetween
I want to replace the SlotNumber like SlotNumber:
location 100 SlotNumber1 location 150 SlotNumber2 location 160 SlotNumber3 ...
Please note that the 100 and 1 doesn't have any relevance. I was looking to use some kind of of a counter within sed and replace SlotNumber with "SlotNumber+Counter" and increment it after every match.
I don't know how many occurrences are there in that file.