title: Get values from the next row and merge- awk
body: <p>I have a pipe delimited file like this</p>
  <pre><code>    OLD|123432
      NEW|232322
      OLD|1234452
      NEW|232324
      OLD|656966
      NEW|232325
  </code></pre>
  <p>I am trying to create a new file where I am trying to merge rows based on the value in the first column (OLD/NEW). First column in the output file will have the new number and the second column will have the old number.</p>
  <p>Output</p>
  <pre><code>232322|123432
  232324|1234452
  232325|656966
  </code></pre>
  <p>I looked at the answer here <a href="https://stackoverflow.com/questions/9605232/how-to-merge-every-two-lines-into-one-from-the-command-line">How to merge every two lines into one from the command line?</a>. I know it is not the exact solution but used as a starting point.</p>
  <p>and tried to make it work to solve this but throws syntax error.</p>
  <pre><code>awk -F &quot;|&quot; 'NR%2{OFS = &quot;|&quot; printf &quot;%s &quot;,$0;next;}1'
  </code></pre>