#!/usr/bin/perl while ( ) { if ( $_ =~ /TABLE;(.*$)/ ) { $table_name = $1; } if ( $_ =~ /COLUMN;(.*);/ ) { print $table_name.'.'.$1."\n"; } }