Count number of lines in a file using DOS

| | Comments (0)

To count the number of lines in a file using DOS, use the following command. Replace filename.txt with the actual filename.

findstr /R /N "^" filename.txt | find /C ":"

This is especially useful when the file is very large (say, over 250k lines) and using NotePad to open the file would definitely hang. Just tested the command on a 1.4M lines file and it took about 2 minutes to give me the result.

Reference: http://brett.batie.com/?p=25

Categories




Leave a comment

About this Entry

This page contains a single entry by Bobby published on October 27, 2009 4:07 PM.

How to use gift cards on Amazon.com was the previous entry in this blog.

Good free FTP/SFTP server for Windows - Core FTP / SFTP Server is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.0