Thoughts of just about anything
Search and replace using perl!
Sunny Walia has a great tip for Search and Replace in a linux box.
For a while now I used to use SED but Sunny suggests using perl’s inplace option (-i) to speed things up. Let me tell you this is a great time saver!.
perl -w -i -p -e "s/search_text/replace_text/g" *.txt
You can read the original article here:
Linux: How do I mass find and replace text in files under linux using perl? | Technology: Learn and Share.
| Print article | This entry was posted by Juan Frias on September 29, 2008 at 10:55 am, and is filed under Linux. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |