Replacing words in a fast way

Hi,
I have a file that looks like this:

br0
br0
br1
br10
br11
br12
br13
br14
br15
br15
br2
br2
br3
br4
br5
br6
br7
br8
br9

Basically what iwant to do is replace br0 with br1, br1 with br2, br2 with br3, br4 with br5 etc...

I did it one by one with awk but it just replaced itself eg. after i replace br1 with br2, then I go and replace br2 with br3 (so everyone gets replaced). Is there a way to avoid this? Also when I replace something into br1 it also replace it into br10 so it becomes br10 again.

So the final output should look like this:

br1
br1
br2
br11
br12
br13
br14
br15
br16
br16
br3
br3
br4
br5
br6
br7
br8
br9
br10

thanks

Phil

try...

while read line
do
num=`echo ${line//[^0-9]/}`
string=`echo ${line%%[0-9]*}`
echo "${string}`expr $num + 1`"
done < file
perl -pe's/(\d+)/$1+1/e' infile

another wonderful answer from radoulov

An alternative solution with awk:

 awk -F br '{print FS $2 + 1}' yourfile
perl -ne '{s/([0-9]+)/$1+1/e;	print;}'