Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 Windows cmd 打印存储在我的计算机上的文本文件的特定行。
例如,如果我想在 cmd 中输出文本文件的第 17 行,这怎么可能?我已经在这方面使用了相当长的一段时间,但我的想法已经不多了。
能否请你帮忙?
问候
马格努斯
@echo off for /f "tokens=1,* delims=]" %%a in ('find /n /v "" ^< "myfile.txt" ^| findstr "^\[17\]" ') do set "variable=%%b" echo "%variable%"