把横板文字TXT拖入批,直接显示出来- @echo off
- setlocal enableDelayedExpansion
- set "InTxt=%~s1"
- for /f "delims=" %%i in ('type "%InTxt%"')do (
- set/aRow+=1,C=0
- set "Str=%%i"
- set "Str=!Str: = !"
- set "Str=!Str:—= !"
- CALL :XY Str !Row!
- )
- for /l %%r in (1 1 %Col%)do (
- for /l %%c in (1 1 %Row%)do (
- if not defined S%%c_%%r set "S%%c_%%r= "
- set "SL%%r=!S%%c_%%r! !SL%%r!"
- )
- echo\!SL%%r!
- )
- pause
- goto :eof
-
- :XY Str %Row%
- if "!%1:~%C%,1!" neq "" (
- set/aC+=1
- if !C!0 gtr %Col%0 set/aCol=C
- set "S%2_!C!=!%1:~%C%,1!"
- goto :XY
- )
复制代码
|