Finding a number in a text file and outputting that line of data
<p>I'm having trouble looping through the content of a text file, searching for a number and then once found, outputting the data on the line which the number exists.</p>

<p>At the moment, no matter what number you specify, it will always output the first line of the text file.</p>

<pre><code>cout &lt;&lt; endl &lt;&lt; "Please enter a staff members ID: ";
cin &gt;&gt; id;
do
{
    inStream.seekg(0, ios::beg);
    getline(inStream, line);
    if (line.find(id))
    {
        cout &lt;&lt; endl &lt;&lt; line;
    }
    else
    {
        cout &lt;&lt; endl &lt;&lt; "Error. Could not find the staff member.\n";
    }
} while (id != id);
</code></pre>
