Reputation: 145
I am trying to print specific lines of a text file stored on my computer by using the Windows cmd.
For instance if I want to output line 17 of the textfile in the cmd, how is this possible? I have been using quite some time on this and I am running out of ideas.
Could you please help?
Regards
Magnus
Upvotes: 0
Views: 6274
Reputation: 41234
@echo off
for /f "tokens=1,* delims=]" %%a in ('find /n /v "" ^< "myfile.txt" ^| findstr "^\[17\]" ') do set "variable=%%b"
echo "%variable%"
Upvotes: 1