sed好简单啊,纯p的好麻烦.- @echo off&setlocal enabledelayedexpansion
- set hh=^
-
-
- (for /f "delims=" %%a in (a.txt) do (
- set "tmp=%%a"
- for %%b in ("!hh!") do echo,!tmp:^&#=%%~b!
- echo ##
- ))>tmp
- (for /f "tokens=1* delims=;" %%a in (tmp) do (
- if not "%%a"=="##" (
- if "%%b"=="" (set/p =%%a) else set/p =%%b
- ) else echo,&echo,
- ))<nul>b.txt
- del tmp
- start b.txt
复制代码
|