Perhaps this is what you want, but I'm not sure if I've understood you
Code:
#!/bin/bash
comp1=($(cat text1.txt | cut -d\; -f 3,4))
comp2=($(cat text2.txt | cut -d\; -f 3,4))
for str in ${comp1[*]}; do
i=0
while (( $i < ${#comp2[*]} )); do
if [[ $str = ${comp2[i]} ]]; then
cat text1.txt | grep $str
fi
(( i += 1 ))
done
done