title: Java - Parsing Text File
body: <p>I have an input text file in this format:</p>
  
  <pre><code>&lt;target1&gt; : &lt;dep1&gt; &lt;dep2&gt; ...
  &lt;target2&gt; : &lt;dep1&gt; &lt;dep2&gt; ...
  ...
  </code></pre>
  
  <p>And a method that takes two parameters</p>
  
  <pre><code>function(target, dep);
  </code></pre>
  
  <p>I need to get this parsing to call my method with each target and dep eg:</p>
  
  <pre><code>function(target1, dep1);
  function(target1, dep2);
  function(target1, ...);
  function(target2, dep1);
  function(target2, dep2);
  function(target2, ...);
  </code></pre>
  
  <p>What would be the most efficient way to call <code>function(target,dep)</code> on each line of a text file?  I tried fooling around with the scanner and string.split but was unsuccessful.  I'm stumped.</p>
  
  <p>Thanks.</p>