time awk -F ';' '/^TABLE/ {table=$2} /^COLUMN/ {printf("%s.%s\n",tabl +e,$2) }' * real 0m0.35s user 0m0.29s sys 0m0.05s time perl -ne '/^TABLE;([^;\n]+)/ && ($table = $1) or /^COLUMN;([^;\n] ++)/ && print "$table.$1\n"' * real 0m0.24s user 0m0.21s sys 0m0.03s time perl -nle '/TABLE;(.*)/?($t=$1):/COLUMN;([^;]*)/&&print(qq{$t.$1} +)' * real 0m4.88s user 0m0.34s sys 0m0.05s
In reply to Re: regular expression to get the tablename.column_name
by greatshots
in thread regular expression to get the tablename.column_name
by greatshots
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |