没有处理 你提供的文本抬头 看则有点乱- @echo off & setlocal enabledelayedexpansion
- md new_files 2>nul
- for /f "delims=" %%o in ('dir /b *.txt') do (
- set "f="
- (for /f "usebackqtokens=1-9" %%a in ("%%o") do (
- set "s="
- set "str=%%d %%e %%f %%a %%b %%c %%g %%h %%i"
- if defined f (
- for %%j in (!str!) do (
- set n=%%j
- if "!n:~,1!" == "-" (
- set s=!s! 0 %%j
- ) else set s=!s! %%j 0
- )
- ) else set f=0&for %%j in (!str!) do set s=!s! +%%j -%%j
- echo;!s:~1!
- ))>"new_files\%%o"
- )
- pause
复制代码
|