|
-
September 19th, 2003, 08:24 AM
#1
Is there a DOS command to count the number of lines in a text file ?
Someone told be there's one in Unix and they suggested there was probably one in DOS.
So, is there or not ?
-
September 19th, 2003, 09:14 AM
#2
I don't remember any version of DOS having native line or word count, it was one of the missing features people wrote utilities to provide, like here:
http://members.optushome.com.au/quentinc/ti.html
-
September 20th, 2003, 11:30 PM
#3
For example:- find/c/v "~`!@#$%^&*()_+" c:\foobar.txt
In other words, we've told FIND to count ("/c") the number of lines that do not contain ("/v") a string of text ("~`!@#$%^&*()_+") that is unlikely to exist in the file ("c:\foobar.txt"). FIND will return a result similar to:- ---------- c:\foobar.txt: 143
(The "143" is the number of lines found).
-
September 21st, 2003, 06:19 AM
#4
Thanks to you both.
Vernon I think I like your option.
Cheers.
-
September 21st, 2003, 11:51 AM
#5
You're Welcome. 
BTW, if you'd rather not see the:- ---------- c:\foobar.txt:
in the DOS (FIND's) response, you could use something like:- type c:\foobar.txt|find/c/v "~`!@#$%^&*()_+"
instead. All you'll get then is simply the number of lines.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|