title: Unix script to count line between pattern of output
body: <p>I am trying to write a unix code where I will be to count no of rows between (ie here 2)</p>
  
  <p>two <code>"|DATE and TIME         | XXXXXX |"</code></p>
  
  <p>Is there any method I can use with combination of egrap and wc -l</p>
  
  <p>Output:</p>
  
  <pre><code>|-------------------------------|
  
  |DATE and TIME         | XXXXXX |
  
  |-------------------------------|
  
  | 21-NOV-2012 15:56:51 | 1259   |
  
  | 21-NOV-2012 15:56:51 | 1364   |
  
  |-------------------------------|
  
  |DATE and TIME         | XXXXXX |
  
  |-------------------------------|
  
  | 21-NOV-2012 16:06:55 | 1259   |
  
  | 21-NOV-2012 16:06:55 | 1364   |
  
  |-------------------------------|
  </code></pre>