perl -ne '/^TABLE;([^;\n]+)/ && ($table = $1) or /^COLUMN;([^;\n]+)/ && print "$table.$1\n"' data.txt