- @echo off
- setlocal enabledelayedexpansion
- rem 假设某txt文档路径为c:\hello.txt
- for /f "usebackq delims=" %%i in ("c:\hello.txt") do (
- set a=%%i
- for %%b in (139 138 137 136 135 134 159 158 157 152 151 150 188 187) do (if %%b==!a:~0,3! echo !a!>>c:\hello移动.txt)
- for %%k in (130 131 132 155 156 186 185) do (if !a:~0,3!==%%k echo !a!>>c:\hello联通.txt)
- for %%l in (133 153 189 180) do (if !a:~0,3!==%%l echo !a! >>c:\hello电信.txt)
- )
- pause
-
复制代码
|