title: parsing a text file using a java scanner
body: <p>I am trying to create a method that parses a text file and returns a string that is the url after the colon. The text file looks as follow (it is for a bot):</p>
  
  <blockquote>
    <p>keyword:url<br/>
    keyword,keyword:url</p>
  </blockquote>
  
  <p>so each line consists of a keyword and a url, or multiple keywords and a url.</p>
  
  <p>could anyone give me a bit of direction as to how to do this? Thank you.</p>
  
  <p>I believe I need to use a scanner but couldn't find anything on anyone wanting to do anything similar to me. </p>
  
  <p>Thank you.</p>
  
  <p>edit: my attempt using suggestions below. doesn't quite work. Any help would  be appreciated.</p>
  
  <pre><code>    public static void main(String[] args) throws IOException {
      String sCurrentLine = "";
      String key = "hello";
  
      BufferedReader reader = new BufferedReader(
              new FileReader(("sites.txt")));
      Scanner s = new Scanner(sCurrentLine);
      while ((sCurrentLine = reader.readLine()) != null) {
          System.out.println(sCurrentLine);
          if(sCurrentLine.contains(key)){
              System.out.println(s.findInLine("http"));
          }
      }
  }
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>    hello,there:http://www.facebook.com
  null
  whats,up:http:/google.com
  
  sites.txt:
  
     hello,there:http://www.facebook.com
  whats,up:http:/google.com
  </code></pre>