中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-29 08:54
47,816 topics / 349,916 posts / today 0 new / 48,265 members
DOS批处理 & 脚本技术(批处理室) » Ask: How to count the number of lines of strings in a text
Printable Version  1,473 / 5
Floor1 bza2006 Posted 2007-03-22 08:23
初级用户 Posts 27 Credits 58
Count the number of strings in any line of the text. For example, if a line has "sdgdsg sdgdsg sdgfdgh", you can know there are 3 strings.
Floor2 lxmxn Posted 2007-03-22 12:23
版主 Posts 4,938 Credits 11,386
Run the following batch script. Enter the file name to be checked, and after pressing Enter, the number of words per line will be displayed. Words are strings separated by spaces or horizontal tabs.
Floor3 bza2006 Posted 2007-03-22 20:42
初级用户 Posts 27 Credits 58
Thanks to the administrator for providing
Floor4 bza2006 Posted 2007-03-22 20:56
初级用户 Posts 27 Credits 58
Continuing to ask: What does!a! mean and how to use it?
Floor5 lxmxn Posted 2007-03-22 21:22
版主 Posts 4,938 Credits 11,386
  Re bza2006:

!a! is equivalent to %a%, which means referencing the value of variable a. But it needs to use variable delay (setlocal enabledelayedexpansion) in for, so use! instead of % to reference its value.

You can take a look at the following related explanations:

http://www.cn-dos.net/forum/viewthread.php?tid=28273&fpage=1&highlight=%E5%8F%98%E9%87%8F%E5%BB%B6%E8%BF%9F

http://www.cn-dos.net/forum/viewthread.php?tid=20733&fpage=1&highlight=%E5%8F%98%E9%87%8F%E5%BB%B6%E8%BF%9F
Floor6 bza2006 Posted 2007-03-23 08:14
初级用户 Posts 27 Credits 58
Thanks for the guidance, and I'm studying hard~
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023