Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: script for removing certain text

by dooberwah (Pilgrim)
on Jun 29, 2001 at 19:00 UTC ( [id://92655]=note: print w/replies, xml ) Need Help??


in reply to script for removing certain text

If I understand your question correctly a regular-expression something like this would work:

s/hello.*goodbye//g;

Where the begin word is "hello" and the end word is "goodbye". If you in *NIX (this might work in Windoze also but I havn't tested it) you could give this as a command line argument using the -p -i and -e switchs:

perl -pi -e 's/hello.*goodbye//g' [FILENAME]

-Ben Jacobs (dooberwah)
one thing i can tell you is you got to be free
http://dooberwah.perlmonk.org

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://92655]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-25 10:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found