I have around 600 files of different stores in a folder. Their name is like StoreNum_MMDD.txt/Txt/tXt/TxT/TXT. I want to find all unique StoreNum.
Please note the extension, the command should search for all possible combinations.
For eg. If 4 files like
123_0221.txt
32145_1220.txt
123_1020.TXT
455_0412.txT
then my output should be
123
32145
455
This is my code:
FOR /F "tokens=1 delims=_ " %%i in (%FILE%) do ( echo %%i )
But this is generating all
123
32145
123
455
where the "123" is repeated