1830042 Members
2235 Online
109998 Solutions
New Discussion

sed - simple one for you

 
SOLVED
Go to solution

sed - simple one for you



have a lines in a file that I would like to change that have numbers that I need to change to 5000

example lines :

dog 23452435 cats
fish 4324 hooks
fishing while raining
_________________________________

would like to have after

dog 5000 cats
fish 5000 hooks
fishing while raining
_________________________________

Like I said it is simple but I just cant seem to get the right results

Steve
2 REPLIES 2
Sandman!
Honored Contributor
Solution

Re: sed - simple one for you

# sed 's/[0-9][0-9]*/5000/g' infile

Re: sed - simple one for you

Perfect answer -- that is what I needed
:)