So i have this batch file that needs to delete a word in a txt file. it needs to delete the "addons" word at the end of this directory: D:\Batch Files\files\addons
Asked
Active
Viewed 707 times
-1
-
2Show us the batch-file, we won't write the whole code for you – Sjon Nov 28 '15 at 20:24
1 Answers
0
This should work. It will create a new file though.
@echo off
setlocal enabledelayedexpansion
FOR /F "usebackq delims=" %%G IN ("Test.txt") DO (
Set "line=%%G" & echo !line:Pie=!
)>>"Test2.txt

Nathan Tuggy
- 2,237
- 27
- 30
- 38
-
you append to the same file, you are reading from. So it doubles your data. Better write to a new file (you can rename it afterwards, overwriting the original file, if needed) – Stephan Nov 29 '15 at 21:05