#!/bin/bash

if [ -e "results.txt" ]
then
    rm results.txt
fi

for f in *.eng
do
    
    awk -F'\t' '{if ($5 ~ /Broadcasting/ || $5 ~ /NO CARRIER/ || $5 ~ /CONNECT/ ) {print $2,$3,$5} if ($39 ~ /CSQ:/) {print $2,$3,$39}}' $f >> results.txt
done

