Computing.Net > Forums > Unix > is there a wild card for pattern?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

is there a wild card for pattern?

Reply to Message Icon

Name: samarjith
Date: January 8, 2009 at 11:09:16 Pacific
OS: Windows 2000
CPU/Ram: Intel(R) Pentium(R) M processor 2.00 GHz
Product: Ibm / T43
Subcategory: Software Problems
Comment:

I want to replace the following in a file.

test1
test2
test3
test4

so is there any wild card to substitute all numeric postions at the end, which can use with test to replace all test strings that ends with a number. Thanks in advance.

Samar



Sponsored Link
Ads by Google

Response Number 1
Name: lankrypt0
Date: January 8, 2009 at 12:39:27 Pacific
Reply:

What do you want to replace those with?


0

Response Number 2
Name: samarjith
Date: January 8, 2009 at 12:58:19 Pacific
Reply:

with "test"


0

Response Number 3
Name: lankrypt0
Date: January 8, 2009 at 12:59:52 Pacific
Reply:

sed -e "s/test[0-9]*/test/g" filename


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: is there a wild card for pattern?

Is There Any FREE internet for Linux? www.computing.net/answers/unix/is-there-any-free-internet-for-linux/1001.html

Is There a C Code Snippet to Rename www.computing.net/answers/unix/is-there-a-c-code-snippet-to-rename/5977.html

Wild Card in the if statment www.computing.net/answers/unix/wild-card-in-the-if-statment/7624.html