You are not logged in.
Pages: 1
I have text file in C:\Temp\targetdir.txt
and and it contains two lines:
C:\Games\some_game\
C:\Games\some_game_TC\
and i want to get rid off that last one with batch file.
i've tried folowing but it del's both of them
findstr /v "_TC\" C:\Temp\targetdir.txt > C:\Temp\targetdir.txt
Offline
Your problem is that you are using the same output filename as the input filename.
C:\Temp\targetdir.txt > C:\Temp\targetdir.txt
Offline
Your problem is that you are using the same output filename as the input filename.
C:\Temp\targetdir.txt > C:\Temp\targetdir.txt
Tested changing output to targetdir2.txt but still the same it del's both lines!
Offline
There is an extra problem related to regular expressions in the Findstr term when using \ and it has to be doubled to \\
(tested in Win 8.1 32 bit)
@echo off
(
echo C:\Games\some_game\
echo C:\Games\some_game_TC\
)>targetdir.txt
type targetdir.txt
pause
findstr /v "_TC\\" targetdir.txt > targetdir2.txt
type targetdir2.txt
pause
Last edited by foxidrive (09 Aug 2015 21:15)
Offline
There is an extra problem related to regular expressions in the Findstr term when using \ and it has to be doubled to \\
(tested in Win 8.1 32 bit)
@echo off ( echo C:\Games\some_game\ echo C:\Games\some_game_TC\ )>targetdir.txt type targetdir.txt pause findstr /v "_TC\\" targetdir.txt > targetdir2.txt type targetdir2.txt pause
Yes! This worked some times it's just so tiny thing what's ruins all code!
Thank you very much again! foxidrive
Offline
Pages: 1