Не могли бы вы попробовать следующее, написанное и протестированное на показанных примерах.
awk '
$3~/[tT][bB]$/{
temp=substr($3,1,length($3)-2)
$3=temp*1024
}
$3~/[gG][bB]/{
$3=substr($3,1,length($3)-2)
}
1
' Input_file |column -t
Пояснение: Добавление подробного объяснения к вышеизложенному.
awk ' ##Starting awk program from here.
$3~/[tT][bB]$/{ ##Checking condition if 3rd field is equal to tT OR bB then do following.
temp=substr($3,1,length($3)-2) ##Creating variable temp which has sub-string from 3rd field.
$3=temp*1024 ##Re-creating 3rd field which has value of temp variable and multiplying it with 1024 here.
}
$3~/[gG][bB]/{ ##Checking condition if 3rd field is having gG OR bB then do following.
$3=substr($3,1,length($3)-2) ##Re-creating 3rd field which has value of 3rd field apart from last 2 char of it.
}
1 ##Printing current line here.
' Input_file | column -t ##Putting output of awk program to column command to beautify it.