方案一,delims:- @echo off&setlocal enabledelayedexpansion
- for /f "tokens=2,3 delims=/" %%a in (a.txt) do (
- if "%%b"=="" echo %%a
- )
- pause
复制代码 方案二,上级路径:- @echo off&setlocal enabledelayedexpansion
- for /f "delims=" %%a in (a.txt) do (
- for /f "tokens=1,2" %%b in ("%%a.. %%a@\..") do if %%~nxb==http: echo %%~nxc
- )
- pause
复制代码 方案三,findstr:- @echo off&setlocal enabledelayedexpansion
- for /f "delims=" %%a in ('findstr /v "\//[^/]*/." a.txt') do (
- for %%b in (%%a@\..) do echo %%~nxb
- )
- pause
复制代码
|