The meaning of Nf,nr in awk

Source: Internet
Author: User
Tags to domain

Awk in the meaning of NF and nr, in fact you already know the meaning of NF and nr, NF is a text file in a row (a record) of the number of fields, NR represents the text file of the number of rows (records). It is often used in programming, especially when it comes to data processing. It is recommended that you look at the information about awk programming, which is a very powerful tool.

Look at an example:

    1. Cal 9 2003
    2. September 2003 # nr=1; nf=2
    3. Su Mo Tu We Th Fr Sa # nr=2; Nf=7
    4. 1 2 3 4 5 6 # nr=3; Nf=6
    5. 7 8 9 Ten # nr=4; Nf=7
    6. * * NR=5; Nf=7
    7. * NR=6; Nf=7
    8. # nr=7; Nf=3
Copy Code


NR refers to the location (line number) of the record that awk is working on in the file
NF refers to the record that awk is working on contains several fields (fields), which are related to domain separators, which are empty by default

The meaning of Nf,nr in awk

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.