Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Beginning Java and the fly likes replace a string in a file using Java Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "replace a string in a file using Java" Watch "replace a string in a file using Java" New topic
Author

replace a string in a file using Java

terry Kiernan
Ranch Hand

Joined: Aug 23, 2008
Posts: 31
Hi ,

Anyone know a simple way i can replace a string in a file using java ?

Thanks
[ August 23, 2008: Message edited by: nanoj ]
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Welcome to JavaRanch!

After checking your private messages, take a look at the String class in the API, which has various replace methods.

Or is your question about file handling? If so, you will need to give us more information about what you've tried and where you're stuck.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: replace a string in a file using Java
 
Similar Threads
Editing html tags in a *.htm file
replacing a regex wild card
How to replace data in a file
Code to Modify the contents of a file
Replacing a word in a text file