--start of script ---
:DeQuote
for /f "delims=" %%A in ('echo %%%1%%') do set %1=%%~A
goto :eof
---end of script----
Usage:
Call :DeQuote <variable name>
Here's an example.
------------value.txt-------------
"Gas"
"Labels"
"Schedule"
"Location"
"Options"
---------end of value.txt----------
Here's the script to clean up the files
-------------start of script-------------
SETLOCAL EnableDelayedExpansion
del /q out.txt
for /f %%i in (value.txt) do (
set tee=%%i
call :DeQuote tee
echo !tee! >> out.txt)
goto :eof
:DeQuote
for /f "delims=" %%A in ('echo %%%1%%') do set %1=%%~A
echo %1
goto :eof
----------end of script-----------------
You will be able to get out.txt as below
------out.txt--------------
Gas
Labels
Schedule
Location
Options
---------------------------
No comments:
Post a Comment