本帖最后由 77七 于 2023-9-2 11:05 编辑
合并- @echo off
- (for /l %%l in (1,1,3) do (
- for /f "useback delims=" %%a in ("%%l.txt") do (
- echo %%a
- )
- echo=
- ))>123.txt
- pause
复制代码
拆分
- @echo off
- setlocal enabledelayedexpansion
- set n=1
- for /f "tokens=1* delims=:" %%a in ('findstr /n .* "123.txt"') do (
- if "%%b" equ "" (
- if exist "!n!.txt" (
- set /a n+=1
- )
- ) else (
- >>"!n!.txt" echo %%b
- )
- )
- endlocal
- pause
复制代码 合并2
- @echo off
- find /v "" *.txt|findstr /irvc:"^-.*\.TXT$"|more /s|more +1>123.txt
- pause
复制代码
合并3
- @echo off
- type *.txt 2>&1|findstr /ivec:".txt"|more /s|more +1>123.txt
- pause
复制代码
|