{ TABLE "foo".bar row size = 50 number of columns = 5 index size = 25 } create table "foo".bar ( var1 char(3) not null constraint "foo".n676_5452, var2 char(3) not null constraint "foo".n676_5453, var3 date not null constraint "foo".n676_5454, _rcd smallint default 0 not null ); revoke all on "foo".bar from "public"; #### $file_name = @ARGV[0]; open (SCHEMA, $file_name); open (BIGLIST, ">>table_names.txt"); open (SMALLLIST, ">>refined_tbl_name.txt"); #open the file while() { $line = $_; #is this a line that declares a new table? if ($line =~ /create table \".+?\"\.(.+?)$/mos) { #if so, print the name into a list print BIGLIST "$1 \n"; #create a new variable that has the name $table_nm = $1; } } #### while ($line ne ')') { $line_cnt++; if ($line =~ /$var_of_interest/) {$keep = 1}; } if ($line_cnt > $n and $keep == 1} then {$table_hash{$table_nm} = 1;}