Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to replace a word in a file with another.

 
pradeep kumar rama
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, can anyone tell me the code to replace a word in a file with another. Eg. The code should be able to replace all the occurences of the word "java" ina file to "j2ee".
 
Balasubramanian Chandrasekaran
Ranch Hand
Posts: 215
Firefox Browser Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pradeep,
...the code to replace a word in a file with another...


May be you can try this link

Text Replacement
 
pradeep kumar rama
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chandra. The url you sent me solved my problem. Many Thanks for your reply. Also can we have any means by which we can do it without using the replaceAll or any other inbuilt function ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic