I'm praying the monks will see through the windows command logic and see a great script that will properly build a changetype modify ldif file from data in 2 different files.
Here's the code that does not work to build an ldif import file. I have 2 files, line for line they match up. One file has all the DN's, the other file has the employeeNumber of each DN. I can't get the two FOR loops to iterate through 2 files one line at a time to build the correct ldif entry, and then proceed through both files iteratively until the last lines.
::Set BATCH Input Directory
::Set the input file containing the list
::If exists, we remove output file
::For loop below process each line in the input list.
FOR /F "tokens=* delims=" %%i IN (%infile%) do (
echo dn: %%i
echo changetype: modify
echo replace: employeeNumber
FOR /F "tokens=* delims=" %%k IN (%infile2%) do (
echo employeeNumber: %%k
20100528 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips