This works in my tests, but it may be too slow for large files and the code is roinky as hell: ::===== begin batchscript merg.bat @echo off & setlocal (for /f "skip=1 tokens=1,2 delims=," %%a in (file1.csv) do ( for /f "tokens=1,2 delims=," %%c in ('findstr /b /c:"%%a" file2.csv^|^|echo x^,0') do ( echo %%a,%%b,%%d ) ) )>merged.csv
(for /f "skip=1 tokens=1,2 delims=," %%a in (file2.csv) do ( findstr /b /c:"%%a" file1.csv>nul||echo %%a,0,%%b ) )>>merged.csv ::====== end batch I'm sure there's a better way to do this (esp. with powershell, which I haven't aquired yet). I just can't think of it.
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this
site. Computing.Net and Purch hereby disclaim all responsibility
and liability for the content of Computing.Net and its accuracy.