awk help,line number

I am grep-ing the word "this" in all the files in my dir.

$ awk '/this/' *
this is
this
this

I want the output as:

1)this is
2)this
3)this

How can I achieve this ? Please help.

HTH,
jkl_jkl

awk '{ printf "%s)%s\n", NR, $0 }' file

This prints the line number, but my query was different :slight_smile:

awk '/this/{i++;print i")"$0}'  *

Thanks :slight_smile: