Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: script for removing certain text

by dooberwah (Pilgrim)
on Jun 29, 2001 at 19:00 UTC ( #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
Node Status?
node history
Node Type: note [id://92655]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2018-06-21 17:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (118 votes). Check out past polls.

    Notices?