- @echo off
- Setlocal enabledelayedexpansion
- set/a strNCount=0,strN=0
- for /f "delims=" %%i in (源文件.txt) do (
- for %%A in (%%i) do set str=%%A&set/a strN=%%A 2>nul
- set endLine=%%i
- call set endLine=%%endLine:!str!=%%
- set/a strNCount+=strN
- )
- for %%i in (!endLine!) do (
- set/p= %%i <nul
- )
- echo,!strNCount!
- pause
复制代码
|