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 @

Re: Replace a string in a text file

2004-03-10 Thread zsdc
Jayakumar Rajagopal wrote: Use this from unix prompt : sed s/fox/coyote/g test.txt > tmp Hey, this is not [EMAIL PROTECTED] mailing list! ;) -- ZSDC Perl and Systems Security Consulting -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Replace a string in a text file

2004-03-10 Thread zsdc
Mr Mojo wrote: 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? You can run this from the command line: perl -pi -es/fox/coyote/g test1.txt Or if you w

Re: Replace a string in a text file

2004-03-10 Thread John W. Krahn
James Edward Gray II wrote: > > On Mar 10, 2004, at 12:56 PM, Mr Mojo wrote: > > > > 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? >

RE: Replace a string in a text file

2004-03-10 Thread Jayakumar Rajagopal
Use this from unix prompt : sed s/fox/coyote/g test.txt > tmp --Jay -Original Message- From: Mr Mojo [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 10, 2004 1:57 PM To: [EMAIL PROTECTED] Subject: Replace a string in a text file Hello, I have a text file (texst1.txt) that reads: The

Re: Replace a string in a text file

2004-03-10 Thread James Edward Gray II
On Mar 10, 2004, at 12:56 PM, Mr Mojo wrote: 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.