When awk reads from the input source it relies on the value stored in the built in variable RS (Record Seperator). The default for RS is a new line. awk takes the input from the current point in the file up to the record seperator and creates a record from that data.
Built in Variables for Records...
Record Seperator. The value awk uses to seperate input into recrods. A new line by default
The Number of Records from this input stream or File. This value will be reset when input streams or files change.
The Number of Records read from all input streams. This value does not automatically get reset.
RS = ";"
The default value of RS is a new line. The value of RS can be changed with the assignment oporator. Example:
will cause awk to seperate records when it sees a semi-colon instead of a new line. However, the default value of RS has some advantages. When default RS is used awk automatically trims leading and trailing spaces from the record itself. This may be a plus unless they are needed.
RT (Recort Terminator) is what awk uses to terminate a record.
The value of FNR is incremented for each record read. But FNR only pertains to the current input source. As the input source is changed e.g. multiple files on the command line, FNR is reset to zero.
NR (Number of Records) is the total number of records read from all input sources during the run of the program. Where FNR is reset when input sources change, NR is not automatically reset.