<? DEW-CODE.COM  

Downloads

Assorted scripts  (1)
DewNewPHPLinks  (9)





Lost Password?
No account yet? Register

Dew-Code Newsfeed

Resources


 USdigitalcable.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 (Admin)
Admin
Posts: 606
graph
User Online Now Click here to see the profile of this user
Dew-Code.com
Search and replace with a PERL one liner 4 Years ago Karma: 9  
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
get the latest posts directly to your desktop
Outsource your projects to thousands of programmers at
ScriptLance.com
Newsflash
Interested in
advertising?

This space for rent!

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