Java, read contents of file from search
<p>I'd like to be able to optomize my code:</p>

<pre><code>} else if (s.equals("2")) {
    System.out.println("Please enter a Name, Phone Number or Email Address: ");
    dataLine = in.readLine();
    String result = readFromFile("C:/AddressBook.dat", dataLine);
    System.out.println("Search Results\n" + result);
</code></pre>

<p>When a user types in a name/phone number/email it will search through the AddressBook.dat file for the entry matching that search result and come back with the completed entry for that search.
So far it only comes back with exactly what was searched.
e.g. search name Jack will come back with just Jack.</p>

<p>I hope this is clear enough and I'm very sorry if this question may have already been answered, I've tried looking for the answer already.</p>

<p>It would probably help if I uploaded my entire code...
<a href="http://pastebin.com/5LY68J5U" rel="nofollow">http://pastebin.com/5LY68J5U</a></p>

<p>Sorry about that!</p>
