Sed Pattern Match

Hi,

I would like to use SED to do the following string replacement:

asd1abc to www1cda
asd2abc to www2cda
...
asd9abc to www9cda

I can use 'asd.abc' to find the orignal string, however I don't know how to generate the target string. Any suggestion?

Thanks,

Mike

$ cat>inputfile
asd1abc
asd2abc
asd3abc
$
$ sed 's/asd\(.\)abc/www\1cda/' inputfile
www1cda
www2cda
www3cda

You may need the global replacement flag if you have more than one matching occurrence to replace per line

sed 's/asd\(.\)abc/www\1cda/g' inputfile