I have two files: File11 and File22. Their first columns are similar and named concatenatedValue. I want to use this concatenatedValue column from File22 and search it in File11 and get the column values corresponding to it from File11. The result can be stored in a new CSV file e.g., output.csv.
I have written a batch script to complete this purpose but it's not working as expected. It opens a CMD window and is just stuck on it, neither showing any output nor anything else.
Also, the batch script code is below:
@REM vlookup kind of funtionality through batch script
@ECHO OFF
for /f "tokens=1 delims=, skip=1" %%i in (File22.csv) do @findstr "%%i," File11.csv >nul & If errorlevel 0 IF NOT errorlevel 1 (for /f "tokens=1,2 delims=," %%m in ('findstr /i /L "%%i," File11.csv') do (@echo %%m,%%n>>output.csv
echo i value: %%i, m value: %%m, n value: %%n)) ELSE (echo %%i,NA>>output.csv)
cmd /k echo Hello
Please guide me in what I'm doing wrong.