Is it possible to do this same thing in Python? Regards, Adi. On 18 Sep 2000, Koos Pol wrote:
On Fri, 15 Sep 2000 14:21:39 -0500 (CDT), Adi Gadwale wrote:
| | what is the unix command line search and replace tool using regex? | | here is an example of what I am trying to do: | | replace the % in "1.01.%" with * to make it "1.01.*" | or to change "%1.345%%" to "*1.345**".
Learn Perl! It's full of little wonders and miracles!
perl -pi -e 's/%/*/g' foo
If you drop 'foo' it will read from STDIN and you can type from the keyboard to see what it does in advance. It will replace any string with any other string depending on any (dynamic!) criterium you wish.
Koos Pol ---------------------------------------------------------------------- S.C. Pol T: +31 20 3116122 Systems Administrator F: +31 20 3116200 Compuware Europe B.V. E: koos_pol@nl.compuware.com Amsterdam PGP public key available
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq