awk -F: ' # set fields separator to :
$1!="" && $2==""{i++;NAME[i]=$1} # if 1st field without second it is app.name
$2!=""{HEAD[$1]=1;DATA[NAME[i],$1]=$2 $3} # put variables name into array
#+ put variables into 2-dimention array app.name,var.name
END{
printf("%s:","Application"); # first column in header
for (n in HEAD) printf("%s:",n); # print all var.name as header separated by :
print ""; # finish line by newline
for(i in NAME){ # for each app.name
printf("%s:",NAME[i]); # print app.name
for (n in HEAD) printf("%s:", DATA[NAME[i],n]); # print each variables corresponding to app.name
print ""; # finish line by newline
}
}' data.file | sed -E 's/:\s*/:/g' | column -s: -tn
sed
retira todos os espaços após :
column
formata colunas de texto