Reading numbers then letters in a text file in C++
<p>I'm trying to do something in C++ and I'm having a little bit of trouble figuring out exactly how to do it.</p>

<p>I have a text file that contains information that I need to parse and act on. The format of the file is multiple lines, each containing a number followed by a letter:</p>

<pre><code>1234 A
5678 B
9101 C
</code></pre>

<p>What I need to do is, line by line, read the number and do a calculation based on it. Then I need to do an operation depending on the value of the letter on that line. Once both operations are finished, I repeat with the next line until all lines from the file have been parsed.</p>

<p>I've found some articles on how to read into strings line by line, but I can't quote figure out how to separate the lines into number and letter.</p>

<p>Any assistance is greatly appreciated!</p>