I have a text file having data something like:

ww1
ww2
ww3
ww4
I want to search for a particular string in this file, so i am reading this file. When the word is found say "ww3" , i wish to edit that entry to something like $$ww3 or ( add anything). I tried using pos() and seek(), but it's deleting all text data from file leaving one or two chars.

I would like to know some way to do this. Please help.

Thanks in advance.