as 只显示在 findstr 中找到的词
As only show the words found in the findstr
如何只显示在搜索中找到的词而不是显示行?
我的代码:
Findstr /li /G:"List.txt" "File.txt">"Result.TxT"
列表:
Disc
Music
Song
Album
结果:
DISC1312we7das67da
13dsdsa67dsahdsa7aMUSIC
dsadsdfdsaSONG1223234235
想要的结果:
Disc
Music
Song
@echo off
(for /F %%a in (List.txt) do (
Findstr /li /C:"%%a" "File.txt" > NUL
if not errorlevel 1 echo %%a
)) > "Result.TxT"
如何只显示在搜索中找到的词而不是显示行?
我的代码:
Findstr /li /G:"List.txt" "File.txt">"Result.TxT"
列表:
Disc
Music
Song
Album
结果:
DISC1312we7das67da
13dsdsa67dsahdsa7aMUSIC
dsadsdfdsaSONG1223234235
想要的结果:
Disc
Music
Song
@echo off
(for /F %%a in (List.txt) do (
Findstr /li /C:"%%a" "File.txt" > NUL
if not errorlevel 1 echo %%a
)) > "Result.TxT"