(批处理文件)如何使批处理文件读取文本文件中的特定行 [英] (Batch File) How to make a batch file read one specific line in a text file
本文介绍了(批处理文件)如何使批处理文件读取文本文件中的特定行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直试图使批处理文件读取一条我使用的特定行:
I have been trying to make a batch file read one specific line I use this:
set "xprvar="
for /F "skip=3 delims=" %%p in (variables.txt) do (echo %%p)
当我使用它时,它会跳到第四行,但它还会读取下一行,有什么办法可以使我只读取一行?
When I use this it dose skip to the 4th line but it also reads the next lines is there any way I can make it just read that one line?
推荐答案
(Aacini回答了我的问题,但他在评论中回答了我,所以我把它贴出来告诉人们这里有答案.)
(Aacini answered my question but he did it in a comment so I posted this to tell people that there is an answer here.)
:Test1
set "xprvar=" for /F "skip=3 delims=" %%p in (variables.txt) do (echo %%p& goto break)
:break
pause
goto END
这篇关于(批处理文件)如何使批处理文件读取文本文件中的特定行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文