Also where can i find examples of this find and replace concept, or sample files etc.,
Thanks for the help!
Detailed information on scripting is here:
http://www.adobe.com/products/indesign/scripting/ (choose Scripting resources)
Samples are here:
(See text folder)
You can also download scripting guide and read the section called "Finding and changing text".
Hope this helps.