BEGIN{
printf("\n..........................................")
printf("\nBranch \t NO of BOOks")
printf("\n..........................................")
}
{
books[$1]=books[$1]+$2
total=total+$2
}
END{
for(x in books)
{
printf("\n %-20s \t %d",x,books[x])
}
printf("\n.........................................")
printf("\ntotal no of books sold: %d",total)
}
printf("\n..........................................")
printf("\nBranch \t NO of BOOks")
printf("\n..........................................")
}
{
books[$1]=books[$1]+$2
total=total+$2
}
END{
for(x in books)
{
printf("\n %-20s \t %d",x,books[x])
}
printf("\n.........................................")
printf("\ntotal no of books sold: %d",total)
}
No comments:
Post a Comment