贴下我的 凑个热闹- @echo off&setlocal enabledelayedexpansion
- set "Tab=#"
- if "%Tab%"=="#" (
- echo.&echo 请先将代码中的 set "Tab=#" 中的#号改为Tab键
- echo.&pause>nul&exit
- )
- set/p str=<139.txt
- echo.1>nul 3>139_new.txt
- for /f "tokens=3* delims=%Tab%" %%i in ("%str%") do set str=%%j
- for %%i in (%str%) do set/a n+=1&set _!n!=%%i
- for /f "skip=1 tokens=1-3* delims=%Tab%" %%i in (139.txt) do (
- set "str=%%i%Tab%%%j%Tab%%%k"
- set "var=%%l"
- set "str1="&set "m="
- set var=!var:%Tab%=%Tab%#!
- call:next "!var!"
- if not defined str1 echo;%Tab%!str!
- )
- echo.1>nul 4>con
- start notepad "139_new.txt"&exit
- :next
- for /f "tokens=1* delims=%Tab%" %%i in (%1) do (
- set/a m+=1
- for %%a in (%%i) do (
- if not "%%a"=="#" (
- set str1=%%a
- set str1=!str1:#=!
- set str2=!str1:*-=!
- call set str1=%%str1:-!str2!=%%
- for /l %%b in (1!str1! 1 1!str2!) do (
- set b=%%b
- if %%b lss 10000 (set b=!b:~-3!) else set b=!b:~-4!
- call echo;%%_!m!%%!b!%Tab%!str!
- )))
- if not "%%j"=="" call :next "%%j"
- )
-
复制代码
[ 本帖最后由 terse 于 2009-2-14 10:58 编辑 ] |