How do I use awk to find the NR of first instance of a specific string after eg NR==10?
I need to find the first instance of the word "class" after a specific NR.
How do I use awk to find the NR of first instance of a specific string after eg NR==10?
I need to find the first instance of the word "class" after a specific NR.
awk 'FNR>10 && /class/ {print FNR}' myFile
To bail out after the first occurrence of "class", modify vgersh99's {print FNR}
to {print FNR; exit}
.
Regards,
Alister