title: Find word and remove word and next set of brackets but leave everything between those brackets
body: <p>I have a file which contains hundreds of similar snippets of the below, how could I use sed (or maybe awk) to change any occurrence of &quot;from table(xxxx)&quot; to &quot;from xxxx&quot;?</p>
  <p>I'm trying to remove the &quot;table&quot; word and any brackets around whatever the actual table name is for &quot;xxxx&quot;?</p>
  <p>There could also be a semi colon &quot;;&quot; on the end of the line too which needs to be kept.</p>
  <p><strong>change this...</strong></p>
  <pre><code>...
       delete from r
       where (r.action_code, r.region_id) in ( SELECT action_code, region_id
                                                 from table(paper_table)  --this line
                                             );
      insert into table_r(action_code, region_id, indicator_ind)
          SELECT t.action_code,
                 t.region_id,
                 t.indicator_ind
                 from table(cheese_table) t;   --this line
  ...
  </code></pre>
  <p><strong>to this...</strong></p>
  <pre><code>...
           delete from r
           where (r.action_code, r.region_id) in ( SELECT action_code, region_id
                                                     from paper_table   --this line
                                                 );
          insert into table_r(action_code, region_id, indicator_ind)
              SELECT t.action_code,
                     t.region_id,
                     t.indicator_ind
                     from cheese_table t;   --this line
  ....
  </code></pre>
  <p>Thanks!</p>