I'm using a batch file to convert XLSB files to CSV - from here: https://stackoverflow.com/a/11252731/9403175
It's great, but I would like to include also subfolders. I have 0 experience writing batch files, so I just copied it (and included one extra argument for sheet name).
The code I'm using:
FOR /f "delims=" %%i IN ('DIR *.xls* /b') DO ExcelToCsv.vbs "qrOUTPUT1" "%%i" "%%~ni.csv"
I Googled that you're supposed to use FOR /R instead of FOR /F, but it doesn't work.
I tried to modify it a bit and also came up with this:
FOR /f "delims=" %%i IN ('DIR *.xls* /b /s') DO ExcelToCsv.vbs "qrOUTPUT1" "%%i" "%%i.csv"
This version on the other hand loops also through subfolders, but incorrectly saves the file as *.xlsb.csv
, instead of just *.csv (as I guess without the ~n
in the last argument it takes the whole file path)
Can someone please help me? I think this should be fairly simple for someone more experienced
Thank you!