中国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-17 23:23
47,814 topics / 349,907 posts / today 4 new / 48,259 members
DOS疑难解答 & 问题讨论 (解答室) » [Help] How to get the line number of a specific string in a file under DOS?
Printable Version  710 / 1
Floor1 i386 Posted 2006-03-13 17:49
初级用户 Posts 16 Credits 176
For example, in a.txt, if it contains the string "abieowdiwoduweiw", how can I get the line number where it is located and store it in a variable? Environment: DOS7.1
Floor2 3742668 Posted 2006-03-13 20:11
荣誉版主 Posts 718 Credits 2,013
Never used DOS 7.1
But both find and findstr in CMD have a /n parameter that can find line numbers
You can check whether 7.1 has them.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023