批处理显示文本中重复出现的内容
展开全部
@echo off
setlocal enabledelayedexpansion
for /f "tokens=*" %%i in (1.txt) do (
for %%j in (%%i) do (set /a #%%j+=1))
(for /f "delims=#=" %%i in ('set #^|findstr /v =1') do if not "%%i"=="" set /p s=%%i <nul)>2.txt
start 2.txt
如果只显示不需要输出到txt,如下
@echo off
setlocal enabledelayedexpansion
for /f "tokens=*" %%i in (1.txt) do (
for %%j in (%%i) do (set /a #%%j+=1))
for /f "delims=#=" %%i in ('set #^|findstr /v =1') do if not "%%i"=="" set /p s=%%i <nul
pause
setlocal enabledelayedexpansion
for /f "tokens=*" %%i in (1.txt) do (
for %%j in (%%i) do (set /a #%%j+=1))
(for /f "delims=#=" %%i in ('set #^|findstr /v =1') do if not "%%i"=="" set /p s=%%i <nul)>2.txt
start 2.txt
如果只显示不需要输出到txt,如下
@echo off
setlocal enabledelayedexpansion
for /f "tokens=*" %%i in (1.txt) do (
for %%j in (%%i) do (set /a #%%j+=1))
for /f "delims=#=" %%i in ('set #^|findstr /v =1') do if not "%%i"=="" set /p s=%%i <nul
pause
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询