|
Query in awk
file "batsmen" contains
Bradman;Australia;52;6996
Gavaskar;India;124;10122
Sobers;West;Indies;93;8032
Border;Australia;109;8075
Miandad;Pakistan;97;7121
Gower;England;94;7023
Boycott;England;108;8114
My awk script contains
awk '{FS=";"}
{len=length($1)};
{printf("%s %d\n"), $1, len}' batsmen
when i run the script i get an output like this
Bradman;Australia;52;6996 25
Gavaskar 8
Sobers 6
Border 6
Miandad 7
Gower 5
Boycott 7
i need the first row as "Bradman 7" but it is not working with this script.
What should i do to rectify this. More over when to use "BEGIN & END"
replies appreciated.
raguram r
|