Hello guys,
I have tried unsuccessfully the following problem with sed and awk
grep commands:
- Try to find a specific word in a text file, and when you find it,
add after that word the number of occurrence of that word,
but leave the first match unchanged, i.e. no addition of the number
for the first match.
For example:
- file A.txt -
122.
123.
124. This
125. is
126. a
127. nice
127. but
127. cold
127. and
127. windy
128. evening.
129.
130.
should become
- file B.txt -
122.
123.
124. This
125. is
126. a
127. nice
127.1 but
127.2 cold
127.3 and
127.4 windy
128. evening.
129.
130.
A solution will be highly appreciated, guys.
Thank you in advance