awk help needed in trying to count lines,words and characters

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])
	}
}

You are very close! Try putting "lines", "chars" and "words" in quotes.

THANKS R.T.
such a silly mistake wasted my 30 mins in morning.
thanks again :slight_smile: