|
From: Bill K. <bi...@ct...> - 2001-09-01 18:06:39
|
From: "Ben Burton" <be...@ac...> > [...] > So basically what I'm going to ask is for all the copyright characters to be > replaced with (c). :) I realise this is an onerous task (although one that > only took me a few minutes with a for loop in bash and a lot of repetitive > keystrokes in vi). Hi, I'm still a Python newbie (so don't know of an optimal Python solution for this yet) but Perl is phenomenal for this sorta thing: find somedir -type f -name "*.java" | perl -i -npe 's/\123/(c)/g' where \123 could be the octal representation of the highbit char to be replaced with (c). (Note: under Windows the -i would have to be changed to something like -i.bak because win perl can't edit files in-place.) Hope this helps, Bill |