title: Awk syntax error pattern matching
body: <p>I want to match every empty line, and when it is an empty line, i want to go to the next line.
  The problem is when i type</p>
  
  <pre><code>/^$/ { next }
  </code></pre>
  
  <p>it always gives me a syntaxt error. It always refers to the first '{'. I thought this was the correct syntax. Can anyone help me please?</p>
  
  <p>My script:</p>
  
  <pre><code>BEGIN{
      FS="  "
      matching=0
      num=0
  }
  {
      /^$/ { next }
      if(matching==1 &amp;&amp; num&gt;=NF){
          print("")
          matching=0
      }
      if(match($NF,type)&gt;0){
          for(i=1;i&lt;=NF;i++){
              printf($i)
          }
          printf("\n")
          num=NF
          matching=1
          next
      }
      if(matching==1){
          for(i=1;i&lt;=NF-num;i++){
              printf("  ")
          }
          printf($NF)
          printf("\n")
      }
  }
  END{
  
  }
  </code></pre>
  
  <p>This is my script</p>