Re: Replace a string in a text file

2004-03-11 Thread Mr Mojo
Thank you to everyone for your help. I have learned a lot! Any your answers were WAY cooler than mine... Greg > perl -pi -e 's/fox/coyote' text_file_name_here.txt > > Is that cool enough? ;) > > James > -- __ Check out the latest SMS services @

Replace a string in a text file

2004-03-10 Thread Mr Mojo
Hello, I have a text file (texst1.txt) that reads: The quick brown fox jumped over the lazy dog. I would like to replace the word fox with coyote. Is there an easier/simpler/cooler way to do this? #!/usr/bin/perl -w use strict; open (FILE, "test1.txt"); open (NEWFILE, ">>tmp"); while () {