本帖最后由 qixiaobin0715 于 2021-10-27 20:47 编辑
假设你的文件格式是.txt。用到了临时文件,我觉得这样效率要好一点。- @echo off
- setlocal enabledelayedexpansion
- for /f "tokens=1* delims=:" %%a in ('findstr /n ".*" base.txt') do (
- if %%a lss 964 (echo,%%b>>a.log) else if %%a gtr 964 (echo,%%b>>b.log)
- )
- for /l %%i in (1,1,1000) do (
- (type a.log
- echo,^<seed^>%%i^<seed^>
- type,b.log)>%%i.txt
- )
- del a.log
- del b.log
- pause
复制代码 未测试 |