title: awk sed perl, replacing specific pattern within a range of lines
body: <p>I'm working in verilog and need to edit a specific line within a unique block, but am unsure of how to proceed</p>
  
  <p>file.v</p>
  
  <pre><code>...
  
      block1 block1(
        .port1(port1),
        .port2(port2),
      );
  
      block2 block2(
        .(port2)(port2),
        .(port3)(port3)
      );
  ....
  </code></pre>
  
  <p>I need to somehow remove the " , " for port2 in block1. without modifying block2. There are also multiple blocks else where that contains port2.</p>
  
  <pre><code>    block1 block1(
        .port1(port1),
        .port2(port2)
      );
  </code></pre>
  
  <p>I've been trying ranges of awk and sed lines, but not getting the results to modify the file successfully. Any suggestions or solutions is much appreciated</p>