Thanks a bundle DRUUNA & MARKUSH i able to solve the problem with your solutions, sorry for the late reply ! both of you certainly made my day as i was totally frustrated due to this problem!
Thaaaaaaaaanks a bunnnnnndle...!
Here how you solved this problem:
1. First solution [druuna]
-->This solution is good when replacing only one line.
#by mistake I didn't mentioned that there are more than one lines to be replaced.
2. Second solution [markus]
-->Replaces all the lines in the file
Thanks again for educating me...!