如何获取文本文件的总行数

问题描述:



我有一个文本文件abc.txt,它看起来像:

12 34 56

23 45 56

33 56 78

... .. ..

...... .. ..


我想知道文本文件中有多少行,怎么做?

谢谢。

Hi,
I have a text file abc.txt and it looks like:
12 34 56
23 45 56
33 56 78
... .. ..
... .. ..

I want to get how many rows totally in the text file, how to do this?
Thanks.



Wei Su schreef:

Wei Su schreef:

我有一个文本文件abc.txt,它看起来像:
12 34 56
23 45 56
33 56 78
.. ..
.. .. ..

我想得到文本文件中有多少行,怎么做?
谢谢。
Hi,
I have a text file abc.txt and it looks like:
12 34 56
23 45 56
33 56 78
.. .. ..
.. .. ..

I want to get how many rows totally in the text file, how to do this?
Thanks.




你可以算一下换行数。



You could count the numbers of linebreaks.


请显示一些细节。谢谢

please show some details. thanks


ThunderBird写道:
ThunderBird wrote:
请显示一些细节。谢谢




请显示一些背景信息,以便人们了解您的情况

无聊。


Robert Gamble。



Please show some context so people have a clue as to what you are
balking about.

Robert Gamble.