Use BEGIN and END when you want some amount of processing to occur
before or
after any file processing has occurred. The code that is in the BEGIN statement will be executed exactly 1 time, and it will be executed before the file you are processing is opened. Likewise, the code in the END block is executed exactly 1 time and it is executed after all code in the main program has been executed.
Use the BEGIN statement for example to print off a report Header, and use an END statement to print the report footer.
Your code:
awk '{FS=";"}
{len=length($1)};
{printf("%s %d\n"), $1, len}' batsmen
You get a printout of the files contents because Awks default action is to print.
Using BEGIN/END you can change your code as follows:
awk 'BEGIN {FS= ";"} {printf("%s %d\n", $1, length($1) )} END {printf("File Processing Complete\n") }' batsmen
gAwk Manual is a great source for Awk information.