replace ' with in a text file

March 9, 2010 at 01:52:24
Specs: Windows XP
I need to replace ' in the file with "
File structure:

See More: replace with in a text file

Report •

March 9, 2010 at 02:02:36
Have you tried this (comes from the SET command):

Environment variable substitution has been enhanced as follows:


would expand the PATH environment variable, substituting each occurrence
of "str1" in the expanded result with "str2". "str2" can be the empty
string to effectively delete all occurrences of "str1" from the expanded
output. "str1" can begin with an asterisk, in which case it will match
everything from the beginning of the expanded output to the first
occurrence of the remaining portion of str1.

Report •

March 9, 2010 at 02:07:16
i tried this command..its working fine when i do it with a string. But there is some problem when i try doing it in a loop for the entire file.

if i do it for a string say c'd'f'g'h' it gives me c"d"f"g"h

but for a file i am unable to do it... :(

Report •

March 9, 2010 at 02:17:52
@echo off > newfile & setLocal enableDELAYedeXpansion

for /f "tokens=* delims= " %%a in (myfile) do (
set S=%%a
set S=!S:'="!
>> newfile echo.!S!

Helping others achieve escape felicity


Report •

Related Solutions

March 9, 2010 at 02:24:10
Hey thanks a worked...
there was some issue with my for loop...

Report •

Ask Question