Top

substitute strings in files

Please Register to submit score.
Average Score  7.0
Scores Submitted  1
Date Added  Aug 24, 2005
Last Updated  Aug 25, 2005

Introduction

Uses a list of regular expressions and replacement strings
to make changes in text files.

Put in file "edit-all.rb" and run with
ruby edit-all.rb *.txt

Now accepts the target and the replacement from the command line or from the keyboard.

Grab the Code

Comments

  (2)  RSS
Hawkee
Comments: 398
 
Ruby / Rails Snippet:  substitute strings in files
Posted on Aug 24, 2005 9:28 pm
Maybe rather than editing the code with the string and replacement string, it can accept them from the command line?
Hawkee
Comments: 398
 
Ruby / Rails Snippet:  substitute strings in files
Posted on Aug 31, 2005 12:12 pm
Nice, I see you've added command line support. This can be very useful.

Please Register or Login to start posting comments.
Bottom