I have a csv file and I need to read its values to one string.
This is what I have for now:
setLocal EnableDelayedExpansion
set FULL_STR=""
for /f "usebackq tokens=1-3 delims=," %%a in ("%CSV_PATH%") do (
set !FULL_STR!=!FULL_STR!%%a%%b%%c
)
echo !FULL_STR! //returns ""
Could anyone help me to do it?
CodePudding user response:
set FULL_STR=""
sets FULL_STR
to ""
.
set "FULL_STR="
sets FULL_STR
to empty.
set !FULL_STR!=!FULL_STR!%%a%%b%%c
sets a variable named [the current contents of FULL_STR
] to [the current contents of FULL_STR
][the two fields from the file]
set "FULL_STR=!FULL_STR!%%a%%b%%c"
sets the variable FULL_STR
to [the current contents of
FULL_STR][the two fields from the file]