- @echo off&setlocal enabledelayedexpansion
- set "t=%time%"
- for /f "delims=" %%a in (a.txt) do (
- set /a m=0,n+=1
- set "str=%%a"&set "str=!str: =空!"
- for %%a in (!str!) do (
- set /a m+=1
- for %%b in (!m!) do (
- set "_%%b=!_%%b!|%%a"
- if !n! equ 50 (
- for %%c in (!_%%b!) do (
- if not defined %%c (
- set "%%c=%%b列"
- ) else (
- if defined .%%c (
- for /f "tokens=2 delims=列 " %%d in ("!.%%c!") do set "..%%d=!..%%d! %%b列"
- ) else (
- set "..%%b=!%%c! %%b列"&set ".%%c=!..%%b!"
- )
- )
- )
- )
- )
- )
- )
- for /l %%a in (1,1,%m%) do (
- if defined ..%%a (
- set "str=!_%%a:~1!
- echo !..%%a!内容相同,列内容如下:
- echo !str:空= !&echo.
- )
- )
- echo %t%
- echo %time%
- pause>nul
复制代码
|