还是计算错了 这个也只是简单测试- @echo off&setlocal enabledelayedexpansion
- set L=5
- set "file=a.txt"
- for /f "delims=U" %%a in ('cmd /u /c echo 唉') do set "tab=%%a"
- for /f "usebackq tokens=*" %%i in ("%file%") do set /a N+=1&set #!N!=%%i
- set /a h=(n+l-1)/l,j=(n%%l)*H,_i=h-1
- if !j! leq 0 set j=n
- for /l %%i in (1 1 %n%) do (
- if %%i leq %j% (
- set /a "m=(%%i-1)%%h+1"
- ) else set /a "m=(%%i--~j)%%_i+1"
- for %%j in (!m!) do set "$%%j=!$%%j!%tab%!#%%i!"
- )
- (for /l %%i in (1 1 %h%) do for /f "tokens=*" %%j in ("!$%%i!") do echo %%j)>csm.txt
- more /t16 csm.txt >nmn.txt
- pause
复制代码
|