@echo off
setlocal EnableDelayedExpansion
set file1=file1.txt
set file2=file2.txt
set out=output.txt
copy nul "%out%"
for /F "usebackq tokens=* delims=" %%A in ("%~file1%") do (
set key=%%A
set key=!key:~,10!
set line=%%A
for /F "tokens=* delims=" %%B in ('findstr /B /L /c:"!key!" "%~file2%"') do (
set line=%%B
set line=%%A!line:~100!
)
>> "%~out%" echo,!line!
)
|