I used regular expression for replace space , tab and it is working fine. Code posted by kebo is also working fine. I decided to use first method.
Thanks a lot all of u for given your precious time.