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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace instances of a string using a wildcard

Status
Not open for further replies.

eholdo

Technical User
May 30, 2002
31
US
Hi Everyone,

I need to replace a string using a wildcard. In other words, a nawk or sed routine to do this:

string to replace "This is a test"

But may occur as "This is not a test"

I want to use something like a wildcard, such as:
"This is * test"

To find and replace both instances in a file.
Any thoughts?
 
sed s/"This is.* a test"/bla/

result: bla

Regards Gregor Gregor.Weertman@mailcity.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top