perl -nle "/TABLE;(.*)/?($t=$1):/COLUMN;([^;]*)/&&print(qq{$t.$1})" file1.txt