Hi Suvigya,
As I mentioned in my previous post, I am not sure how we can do this easily in Snaplogic, may be someone more expert in it will give you some good idea. I asked you about size because if it is not that big like few MB(s) or depending on the machine on which you are processing this file, you can write a simple program in any programming language, I would prefer Python because you can do complex things with few lines of code in it, you can achieve desired output very easily. Implementing your requirement is pretty easy in Python.
Thanks
Aditya