Thank you for the reply.
If the tags are in continuous order generating sequence number would be easy.
For e.g. A 100 A 200 A 300. Each time A is encountered sequence number can be incremented. However if a series of tags are repeating, for e.g. A 100 B 100 A 200 B 300, then
for the first occurance of A and B, the sequence number should be 1 and for the next it should be incremented. In other words whenever a tag is repeated in the input file, the sequence number should be incremented. The repeatition of the tags is not guarenteed. They may occur.
Thank you,
Gowtham