Merge MAC Address Files with Case Conversion

@Echo off
Title Administrative Compare and Output
color 0a
SETLOCAL ENABLEDELAYEDEXPANSION

REM ——————————————————————————————–
for /f “tokens=1,2 delims=,” %%a in (list1.txt) do (
for /f “tokens=1,2 delims=,” %%c in (list2.txt) do (

SET string1=%%a
SET string2=%%c

rem do case conversion – comment out to skip case conversion
CALL :LCase string1 macadd1
CALL :LCase string2 macadd2

echo COMPARE MAC1-!macadd1! to MAC2-!macadd2!
if !macadd1! EQU !macadd2! echo SUCCESS! && echo %%b %%d & echo %%b,%%d>>computers.txt
rem timing, remove to speed up
Rem ping -n 2 127.0.0.1>nul
)
)
REM ——————————————————————————————–
echo COMPLETE!
pause

:LCase
:UCase
:: Converts to upper/lower case variable contents
:: Syntax: CALL :UCase _VAR1 _VAR2
:: Syntax: CALL :LCase _VAR1 _VAR2
:: _VAR1 = Variable NAME whose VALUE is to be converted to upper/lower case
:: _VAR2 = NAME of variable to hold the converted value
:: Note: Use variable NAMES in the CALL, not values (pass “by reference”)

SET _UCase=A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
SET _LCase=a b c d e f g h i j k l m n o p q r s t u v w x y z
SET _Lib_UCase_Tmp=!%1!
IF /I “%0″==”:UCase” SET _Abet=%_UCase%
IF /I “%0″==”:LCase” SET _Abet=%_LCase%
FOR %%Z IN (%_Abet%) DO SET _Lib_UCase_Tmp=!_Lib_UCase_Tmp:%%Z=%%Z!
SET %2=%_Lib_UCase_Tmp%
GOTO:EOF

email me