I'm trying to find common string in two text files. For example, first text file contains following 1.txt
//documents #5
##text
//documents/A #6
//documents/B #7
second text file contains following: 2.txt
//documents/A #3
output.txt
//documents/A #6
If common string found, expected output last number taken from 1.txt file. try.cmd
@echo off
awk "NR==FNR {a[$0]=1;next} !a[$0]" 1.txt 2.txt > output.txt
for /F "usebackq tokens=1" %%A in ("output.txt") do (
echo %%A