回复 10# zxsg_521
哦,我理解错了,试试看(测试文本.txt的第一行为Name PlantTag Description Type Choice LowLimit HighLimit Unit SysID)- @echo off&setlocal enabledelayedexpansion
- for /f "delims=" %%a in (测试文本.txt) do (
- if defined str (
- for %%b in (%%a) do set "name=%%b"
- if exist !name!.txt (echo,%%a>>!name!.txt
- ) else (echo,!str!&echo,%%a)>!name!.txt
- ) else set "str=%%a"
- )
复制代码
|