Hello,
i am trying to write a script file in awk which yields me the number of lines,characters and words, i checked it many many times but i am not able to find any mistake in it. Please tell me where i went wrong.
BEGIN{
print "Filename Lines Words Chars\n"
}
{
filename[FILENAME,lines]=filename[FILENAME,lines] + 1
filename[FILENAME,words]=filename[FILENAME,words] + NF
filename[FILENAME,chars]=filename[FILENAME,chars] + length($0)
}
END{
for(i=1;i<ARGC;i++){
printf("%10s %5d %5d %5d\n",ARGV,filename[ARGV,lines],filename[ARGV,words],filename[ARGV,chars])
}
}