What does NR represent in awk?

In awk, NR stands for "Number of Records." It is a built-in variable that keeps track of the total number of input records processed so far. Each time awk reads a new line of input, NR is incremented by one. This allows you to perform actions based on the line number, such as skipping the header line or processing specific lines in a file.

0 Comments

no data
Be the first to share your comment!