Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to create one string from values from CSV file in bat file?

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?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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 ofFULL_STR][the two fields from the file]

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading