AWK remove string in between ()

Hi Everyone,

1.txt

test here (888_f)a/fff (eeee) test2 (q)--(qq)

the output is

test here a/fff  test2 --

means remove the characters in between (), and () itself. Please advice.

Thanks

Try:

echo 'test here (888_f)a/fff (eeee) test2 (q)--(qq)' | sed 's/([^)]*)//g'

with awk:

echo 'test here (888_f)a/fff (eeee) test2 (q)--(qq)' | awk -F"[()]" '{for(i=1;i<NF;i+=2){printf("%s",$i)};print ""}'

Same thing in AWK

$ echo 'test here (888_f)a/fff (eeee) test2 (q)--(qq)' | awk 'gsub( /\([^\)]*)/, "" )'
test here a/fff  test2 --

Thanks :b: