These work out of the box on Linux, OSX etc:
Perl
perl -ne 'chomp; /\((.+?)\)/; print "\"$_\" => \"$1\"\n"' list.txt
more Perl, this one uses magic:
perl -ane 'print "\"@F\" => \"$F[$#F]\"\n"' a
awk/gawk
awk -F '[()]' '' list.txt
@evilsoup's sed
sed -e 's/(\(...\))/(\1)" => "\1"/' -e 's/^/"/' list.txt
None of these change the original file, use -i
for the Perl and sed
options or redirect the output if you want to save:
command list.txt > new_list.txt