|
Try this.
Save the below code in chris2.awk
{
if (substr($1,1,5)=="Store") {
if (NAME!="")
{
printf("%15s:%15s Deployments\n", NAME, COUNT)
}
COUNT=0
NAME=$1
}
else
{
COUNT=COUNT+1
}
}
and if your input file is chris2.txt then run the below command.
awk -f chris2.awk chris2.txt
Thanks,
Chris.
|