The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
find and replace pattren in file
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
find and replace pattren in file
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
6
(
permalink
)
08-09-2007
robotronic
Can I play with madness?
Join Date: Apr 2002
Location: Italy
Posts: 370
Agreeing with your request, the {alphanumeric string with underscore} corresponds to "[0-9a-zA-Z_][0-9a-zA-Z_]*". So:
Code:
sed
"s/ [0-9a-zA-Z_][0-9a-zA-Z_]*:/x/g" file1.txt
But I think this is better:
Code:
sed
"s/ .*:/x/g" file1.txt
Bye
robotronic
View Public Profile
Find all posts by robotronic
Find robotronic's past nominations received
Find robotronic's present nominations given