You're viewing a comment by Jason and its responses.

Jason Permalink
January 25, 2013, 22:41

Hi guys, someone can help me?
I had to write an awk script that count the number of single a in a file, and counts the number of lines where there are that a...

I wrote only this that give me the total number of a, but I don't know how to find total number of line containing this character:
awk '{for(i=0;i<NF;i++) if ($i=="a") n++} {print "Tot # of a is "n}' filename

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "antispam_92": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.