Computing.Net > Forums > Disk Operating System > Count lines in dos

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Count lines in dos

Reply to Message Icon

Name: fadi yousef
Date: July 3, 2003 at 13:01:42 Pacific
OS: DOS V.5
CPU/Ram: 2 G
Comment:

How can i get the line count in a text file in DOS (using a batch file) ?

Thanks



Sponsored Link
Ads by Google

Response Number 1
Name: bitbyte
Date: July 3, 2003 at 13:50:35 Pacific
Reply:


if there is no batch solution the you can download lines.com

example:
lines test.txt

download at http://plop.at


0

Response Number 2
Name: Secret_Doom
Date: July 3, 2003 at 14:07:24 Pacific
Reply:

The following will output the number of lines from filename.ext:

FC /n filename.ext nul |FIND /c ":"

If it's slow, try this other similar way:

FC /n filename.ext nul > %temp%.\$
FIND /c ":" %temp%.\$
del %temp%.\$

-- Leonardo Pignataro - Secret_Doom --

secret_doom@hotmail.com
www.batch.hpg.com.br


0

Response Number 3
Name: Secret_Doom
Date: July 3, 2003 at 14:09:49 Pacific
Reply:

By the way, I don't know since which version of DOS the commands FC.exe and FIND.exe were avaliable, I'm not sure they're present on DOS 5.0, but I think they are.

-- Leonardo Pignataro - Secret_Doom --

secret_doom@hotmail.com
www.batch.hpg.com.br


0

Response Number 4
Name: tjoad010
Date: July 23, 2003 at 04:02:58 Pacific
Reply:

How can this be used to count more than one file?

Thanx


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Count lines in dos

Count line in a text file www.computing.net/answers/dos/count-line-in-a-text-file/14001.html

joystick command line in dos? www.computing.net/answers/dos/joystick-command-line-in-dos/2294.html

How do I write directly to a file in DOS? www.computing.net/answers/dos/how-do-i-write-directly-to-a-file-in-dos/2394.html