I have a batch file I created to extract only the columns I need from a csv file. recently, they added 16 more columns and it broke my script essentially.
My script is as follows.
@echo off
setlocal
del /f /q "output.csv"
REM The Distinguished Name of the container the new users will be placed in.
set filename="I9D14B20.csv"
for /F "skip=1 tokens=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38 delims=," %%A in (I9D14B20.csv) do (
echo %%M,%%N,%%I,%%H,%%K,%%AI>>output.csv
)
type output.csv
endlocal
pause
When it had 22 columns it worked fine, but now that they added a bunch more, I need to pull column 35 out (aka AI)
It "breaks" at the second letter. I also tried %%35 but it only pulls column 3.
I know this has to be easier than I am making it, but I am pretty limited in my knowledge of .bat scripting.