edit fields awk

Hi there, i need some help please...
I have this text, it's name data.txt that contains the following information:

Mark Owen: 6999999888 6999999888 +302310999999 2310999999
Steve Blade Pit: +30691111222 2310888777 6999999888  
John Rose: 2310777555 310544565 +302310999999
Mary Stuart: 6999999888 6999999888 6999999888 310544565
George Other One: 6999999

888

Names and their telefone numbers.
Some numbers do not start with +30, I want every number to start with +30 (because it's a code) using sed, grep, awk.

Please, help me...

sed "s/ \([0-9]\{1,\}\)/ +30\1/g" file

A small variant one with sed:

 
sed 's/ \([0-9][0-9]*\)/ +30\1/g' input_file

Thanks guys!
It works ! :slight_smile: :b:

An awk version too..Which i like :wink:

 
awk '{ for (i=1;i<=NF;i++) { ($i  ~ /[0-9]/)&&($i !~ /^\+30/)?$i="+30"$i:$i}}1' input_file

@panyam,
I couldn't understand the last part of your awk :

Could you please explain??

Sure,

If the field is a number and does not start with +30: (true) append to the field the value +30: (false) put the number as it is

@panyam
Thanks,
That means : is kind of else statement in awk