I'm new to programming .bat files. I need to create a batch file that deletes all "" in a txt file. For example, I would want the following:
"","","","01","","Dan",
to look like this:
,,,"01",,"Dan",
Any ideas?
I'm new to programming .bat files. I need to create a batch file that deletes all "" in a txt file. For example, I would want the following:
"","","","01","","Dan",
to look like this:
,,,"01",,"Dan",
Any ideas?
setlocal enabledelayedexpansion
for /f "delims=" %%i in (file.txt) do set a=%%i&set a=!a:""=! &echo !a!>>new.txt
this will make a new file "new.txt" with the ""s removed. to over write the old file add this:
del a.txt&ren new.txt a.txt
Use find and replace
Find "" and replace it with nothing (keeping 'replace with' box empty)
This uses a helper batch file called repl.bat
from - http://www.dostips.com/forum/viewtopic.php?f=3&t=3855
Put repl.bat
in the same folder as the batch file
and text file
, or you can type this at a cmd prompt in the folder with repl and the text file.
@echo off
type "file.txt" |repl.bat "\x22\x22" "" >"newfile.txt"