I am creating a text file that displays a file extenstion of each file in the folder. I want to get rid of duplicate since it creates a line of text for each file.
After a bit of searching, I figured out I should use findstr to overwrite the initial file with a new version that has specific extension removed (after I write it to the filtered file).
for %%A in (*.*) do echo %%~xA >> initial.txt
for /F %%B in (initial.txt) do (
echo %%B >> filtered.txt
for /F %%C in (initial.txt) do findstr /v %%C initial.txt > initial.txt
)
but it leaves the initial file empty (as expected) while still copying every single line to the filtered.txt file. I'd be very glad for some help.