回复 1# fs999 - @ECHO OFF
-
- REM 高位不能大于2147483646
-
- REM 源文件路径
- SET "SourecFile=D:\a.txt"
-
- IF "%1" NEQ "" SET "SourecFile=%1"
-
- REM 输出文件路径
- SET "OutputFile=D:\ok.txt"
-
- REM 高低位间分隔符
- SET DelimsChar=、
-
- REM 输出用分隔符
- SET SplitChar=,
-
- SET /P=""<NUL>%OutputFile%
-
- FOR /F "tokens=1-3 delims=%DelimsChar% " %%a IN (%SourecFile%) DO (
- FOR /L %%a IN (%%a,1,%%b) DO (
- IF %%a NEQ 0 (
- IF %%a EQU %%b (
- ECHO %%a>>%OutputFile%
- ) ELSE (
- SET /P="%%a%SplitChar%"<NUL>>%OutputFile%
- )
- )
- )
- )
-
- ECHO DONE,OUTPUT TO %OutputFile%
- PAUSE
复制代码
|