I'm writting a script in Windows, a .BAT file, to replace:
"""2014
With:
"""14
But I'm havng problems with de double quote character. This is how the script looks like:
@echo off
setlocal enabledelayedexpansion
set INTEXTFILE=FILE_IN_CSV.csv
set OUTTEXTFILE=222.csv
set SEARCHTEXT=^"^"^"2014
set REPLACETEXT=^"^"^"4
set OUTPUTLINE=
for /f "tokens=1,* delims=¶" %%A in ( '"type %INTEXTFILE%"') do (
SET string=%%A
SET modified=!string:%SEARCHTEXT%=%REPLACETEXT%!
echo !modified! >> %OUTTEXTFILE%
)
del %INTEXTFILE%
rename %OUTTEXTFILE% %INTEXTFILE%
Any ideas?
EDIT:
Now I see the problem. What I need to replace is not:
"""2014
Actually is this:
""
"2014
Note that there is an ENTER, I mean the string is in two lines.
EDIT2:
Looks more complicated now: after de 2 double quotes there are 2 blank spaces and then de "ENTER"
""
"2014
So, something like: (doublequotes)(doublequotes)(blanck_space)(blanck_space)(new_line)(doublequotes)2014
Thanks!