I began with an excel spreadsheet with a couple of columns (a Date of Birth, and a Last Name column). I extrapolated and used a batch file to modify just the date of birth column so that I now have a text file with the following (to be used in a SQL query):
BirthDateTime = '01/01/2017' AND Name LIKE '
BirthDateTime = '01/01/2016' AND Name LIKE '
I now want to take the second column (by creating a separate lastname.txt file) and concatonate it into the output file above line for line so that my last name file, which looks like:
SMITH
JONES
Will merge to a new output file that will look like:
(BirthDateTime = '01/01/2017' AND Name LIKE '%SMITH%') OR
(BirthDateTime = '01/01/2016' AND Name LIKE '%JONES%') OR
Unfortunately I'm a newbie on batch files and I just don't know where to start. I'm including the batch file I used to create the first part below.
Batch File:
@echo off
setLocal EnableDelayedExpansion
for /f "tokens=* delims= " %%a in (input.txt) do (
set /a N+=1
echo BirthDateTime = '%%a' AND Name LIKE '>>output.txt
)