perl -ne "print \$1,\$/ if m/\\w+\\s+(.*)\\)\$/" test.txt