I'm trying to parse the following file:
However, as you can imagine, I'm not able to parse the first row due to the special chracters. I think I need to toggle between delayexpansion but unable to be successful.Update,Target Type,FP&A,Workforce,Real Estate,file1,file2
Update Legal Entity,TRUE,DEV,TRUE,TRUE,FALSE,REG1, test.csv
here is what I have so far - can someone assist?
Code: Select all
@echo off
setlocal enabledelayedexpansion
set /A elementNumber=0
for /F "tokens=*" %%L in (Process_Automation.csv) do (
rem clear out elementNumber
echo %%L
call :parse %%L
)
:parse
setlocal
set list=%*
echo !list!
for /F "tokens=1* delims=," %%f in ("!list!") do (
set /A elementNumber+=1
rem if the item exist
if not %%g == "" call :parse %%g
)
endlocal
goto :eof