title: Ruby Extract Slippery Text Columns
body: <p>I am needing to get some columnized-text into <code>ruby</code> arrays.  They are company names, phone numbers and websites.  I've obscured the actual data in order to focus on the parsing as opposed to the nature of the data, which I can deal with.  </p>
  
  <p><a href="https://gist.github.com/daBee/5f6dc2af83dccda8a174cb72736c2e13" rel="nofollow noreferrer">here is the Gist</a></p>
  
  <p>As you can see, the nature of the columnar data changes, including:</p>
  
  <ul>
  <li>leading whitespace width changes, from 0 to ~8</li>
  <li>some lines are "" or <strong>\s+{3,}</strong></li>
  <li>column width changes depending on which block it's in (see how line 31 changes from 27)
  
  <ul>
  <li>therefore reliance upon using widths becomes problematic</li>
  </ul></li>
  <li>some lines show empty entries in columns
  
  <ul>
  <li>empty column 1 on line 4 (example)</li>
  <li>empty column 2 on line 2 (example)</li>
  <li>empty column 3 on line 3 (example)</li>
  </ul></li>
  </ul>
  
  <p>I'm wanting to get this organized into col1, col2 and col3 as arrays of entries.  I can split them later on <strong>/\s*/</strong> and choose the first element. </p>
  
  <p>Given the obvious structure of these three columns, I'm thinking there is a pragmatic way of parsing these columns out into arrays of entries, one per line.  </p>
  
  <p>Does anybody have any insight into how to parse out the columns?  <code>Columns</code> -> <code>arrays</code> <code>col1</code>, <code>col2</code>, <code>col3</code> is the format which I seek.</p>
  
  <p>Any advice/insight appreciated.</p>