I have 10 text files in the same folder with lists like the following:
abc0012345
abc0012346
abc0012347
abc0012348
abc0012349
abc0012350
abc0012351
abc0012352
I have a remove.txt file containing the strings I want to remove, it contains abc0012347
and abc0012351
and I also want to remove the blank space they will leave behind
With my code below I can list if the strings can be found in the 10 text files but I'm having trouble removing the strings
:: /i `: Specifies that the search is not to be case-sensitive.
:: /g: file `: Gets search strings from the specified file.
Rem "List of systems before removing from tag files"
echo off
c:
cd C:\StringFiles
findstr /I /G:"remove.txt" *.txt
pause
rem the following line removes specific entry from text file but I need it to look in the remove.txt file for the strings to remove and then loop through all text files
rem type C:\E\TagFiles\2.txt | repl "stc0012345+" "" X | repl "\r?\n?\s*$" "" M > C:\E\TagFiles\2.out.txt`