0

for example, my text file

1
abc
def
xyz

how can i code a program to count total of line ?
thank you.

5
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by CimmerianX
0

You posted in the Apple, IOS category..but you are asking about a program to count the lines in a text file. Can you elaborate on exactly what you are asking?

Also, are you working with a specific progamming/scripting language?

0

MS. It’s easy to tell that Microsoft’s scripting technologies weren’t written by people who do system administration for a living. Our scripting technologies are jam-packed with features and capabilities, yet we always seem to missing the things that people really want to do. Counting the number of lines in a text file is a good example of that. This seems to be something system administrators do on a regular basis; after all, this is the fourth or fifth time we’ve been asked this question just this month. And yet, there’s no straightforward way to count the number of lines in a text.

0

In MacOS or Linux use
wc -l <filename>

In windows, I don't know of a command line tool. I just use notepad++ to check the file.

A google search will give you various scripts to do the same from cli.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.