Commands for counting the number of rows under Windows

Source: Internet
Author: User

It is known that the number of lines of text counted under Linux can be used with the Wc-l command. Like what:

-bash-3.2$ Cat Pif_install.log | Wc-l
712

But how to count the number of lines of output text under Windows, the answer is to use the FIND/C command

1. Count The number of rows that include a string .

such as the number of time_wait when the network connection is counted.

Netstat-an | find/i/C "Time_wait"

The/I parameter here ignores uppercase and lowercase. The/c parameter is the number of rows or records that are counted to include the "time_wait" string.

2. Count the total number of rows . Find also has an option/C. means the number of rows that do not include a string, which enables you to count the number of lines of text. Like what:

C:\users\nr>type Test.txt | find/v/C ""
253

Note: Empty lines in the file are not counted except for the last blank line. The remaining empty rows are counted correctly.



Commands for counting the number of rows under Windows

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.