title: Ruby - Converting text file to array
body: <p>I'm very new to Ruby on Rails and am using it to augment some C++ code. My C++ code currently outputs data from a multi-dimensional array to a text file like such:</p>
  
  <pre><code>2 2 2 2 2 3 1 1 1 1 5 2 2 2 2 2 
  2 2 2 3 1 1 1 1 1 1 1 1 5 2 2 2 
  2 2 1 1 1 1 1 1 1 1 1 1 1 1 2 2 
  2 3 1 1 1 1 1 1 1 1 1 1 1 1 5 2 
  2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 
  3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 5 
  1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 
  1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 
  1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 
  1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 
  6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 
  2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 
  2 6 1 1 1 1 1 1 1 1 1 1 1 1 4 2 
  2 2 1 1 1 1 1 1 1 1 1 1 1 1 2 2 
  2 2 2 6 1 1 1 1 1 1 1 1 4 2 2 2 
  2 2 2 2 2 6 1 1 1 1 4 2 2 2 2 2 
  </code></pre>
  
  <p>I'm looking for help in converting this text output into a two-dimensional array for Ruby input with dynamic height/width.
  So far I've been inputting them by hand into my Ruby code but will soon be doing a lot more tests and I haven't been able to find a way to convert this into a two-dimensional Ruby array so far. Any help would be great!</p>