Find programmers and grapic design experts at ScriptLance.com
<? DEW-CODE.COM  
Dew-Code
Welcome, Guest
Please Login or Register.    Lost Password?
Search and replace with a PERL one liner (1 viewing) (1) Guest
Post your PERL related questions or observations here. Code snippets are always welcome.
Go to bottom Post Reply Favoured: 0
TOPIC: Search and replace with a PERL one liner
#210
Dewed (User)
Administrator
Posts: 250
graph
User Offline Click here to see the profile of this user
Dew-Code.com
Search and replace with a PERL one liner 7 Months, 3 Weeks ago Karma: 7  
Quite possibly the most used item in my bag of tricks

Code:

perl -pi -e "s/old text/new text/gi;" filename.txt
Remove the g to only replace the 1st occurance of old text. Remove the i to make it case sensitive.
 
Report to moderator   Logged Logged  
 
Nothing to it but to Dew it !
Dew-Code.com
  The administrator has disabled public write access.
      Topics Author Date
    thread link
Search and replace with a PERL one liner
Dewed 2008/05/20 14:21
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Newsflash

Sign up for PayPal and start accepting credit card payments instantly.
Copyright Dew-Code 2008