I have the following multi-line output:
Volume Name: GATE02-SYSTEM
Size: 151934468096
Volume Name: GATE02-S
Size: 2000112582656
Is it possible to convert strings like:
Volume Name: GATE02-SYSTEM
Size: 141.5 Gb
Volume Name: GATE02-S
Size: 1862.75 Gb
with sed/awk? I looked for answers for the only number output like:
echo "151934468096" | awk '{ byte =$1 /1024/1024**2 ; print byte " GB" }'
but can't figure out how to apply it to my case.
EDIT: I'd like to clarify my case. I have the following one-liner:
esxcfg-info | grep -A 17 "\\==+Vm FileSystem" | grep -B 15 "[I]s Accessible.*true" | grep -B 4 -A 11 "Head Extent.*ATA.*$" | sed -r 's/[.]{2,}/: /g;s/^ {12}//g;s/\|----//g' | egrep -i "([V]olume Name|^[S]ize:)"
which generates output above. I want to know what to add more after the last command to get the desired output.