Windows Batch file to echo a specific line number

后端 未结 4 966
花落未央
花落未央 2020-12-06 03:38

So for the second part of my current dilemma, I have a list of folders in c:\\file_list.txt. I need to be able to extract them (well, echo them with some mods)

4条回答
  •  余生分开走
    2020-12-06 04:13

    Bah, it ate my formatting.

    @echo off
    
    setlocal enabledelayedexpansion
    
    set /a counter=0
    set %%a = ""
    
    for /f "usebackq delims=" %%a in (c:\file_list.txt) do (if "!counter!"=="%1" goto :printme & set /a counter+=1)
    
    :printme
    
    echo %%a%
    

提交回复
热议问题