Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PERL substitution like SED does

Status
Not open for further replies.

suhaimi

Technical User
Aug 3, 2001
71
US
Hi all,
How do I do this in perl command line???
I have SED script:
myvar="test"
cat a.txt|sed '/'$myvar'/ !s/.*MYSTR/#&/g'
What does it do is it will PUT '#' character in front of a whole line of strings that --> CONTAIN &quot;MYSTR&quot; <-- BUT
--> DO NOT CONTAIN &quot;test&quot; <--.

Please help, how do I do this in perl command line???

Thanks,
Suhaimi


 
You would be much better off asking this question in the PERL forum. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top