title: awk split one column into multiple columns
body: <p>How can split one column data into multiple columns based on column values using <code>awk</code>?
  Example file and desired output is below. My <code>bash</code> version is 3.2.52(1).</p>
  
  <pre><code>$ cat examplefile
  A
  1
  B
  2
  B
  3
  C
  10
  C
  11
  C
  13
  A
  4
  B
  5
  B
  6
  B
  7
  C
  14
  </code></pre>
  
  <p>Desired output:</p>
  
  <pre><code>$ cat outputfile
  A        B      C
  1        2      10
  null     B      C
  null     3      11
  null    null    C
  null    null    13
  A       B       C
  4       5       14
  null    B       null
  null    6       null
  null    B       null
  null    7       null
  </code></pre>
  
  <p>Or forget about null values How can I obtain two columns as in the outputfile2?</p>
  
  <pre><code>cat examplefile2
  A
  1
  B
  2
  B
  3
  cat outputfile2
  A   B
  1   2
      B
      3
  </code></pre>