title: JAVA: How to parse Integer numbers (delimited by a variable number of spaces) in a line of a text file
body: <p>I want to parse numbers in a line of a text file line by line. For example, imagine _ as a space</p>
  
  <p>my text file content looks like:</p>
  
  <pre><code>___34_______45
  _12___1000
  ____4______167
  ...
  </code></pre>
  
  <p>I think you got the idea. Each line may have variable number of spaces separating the numbers, meaning there is no pattern at all. The simplest solution could be read char by char and check if it is a number and go like that until the end of the number string and parse it. But there must be some other way.
  How can I read this in Java automatically so that I can get in a certain datastructure say array</p>
  
  <pre><code>[34,45]
  [12,1000]
  [4,167]
  </code></pre>