New
#1
CMD Prompt / PS / Batch - Find Unique Values in a .TXT File
I am trying to find ALL the UNIQUE values in a.TXT
file [ C:\Users\System-Admin\Desktop\Test_File.txt ] that are betweenTWO
Percentage Signs [ % ]. Basically, there are MANY lines in a file in the format%nnn%
for example, MANY of which are duplicates. I would like to output just the UNIQUE ones with the Percentage Sign [ % ] included at the beginning and the end, which is exactly how they appear in the file.
I doNOT
want the whole lines just the Percentage Signs [ % ] around what is inside them.
This produces DUPLICATES of EVERYTHING including the WHOLE line that has the criteria I want . . .
Code:findstr /i "%*%" C:\Users\System-Admin\Desktop\Master.bat
Some of what I have tried using isfor /f "tokens=1 delims=," %i in . . . etc
,Find
andFindSTR
but without much success.
Thanks.
Last edited by Paul Black; 19 Sep 2021 at 16:24.