How to read input string with spaces of certain length from text file c++
<p>My problem is that I am trying to input char, string then int from a text file. I know how to input using getline(), however after using the get line() function there is no longer an option to input the rest of the integers following the string. My question is, how can I input a char, then a string (with spaces) followed by 3 ints? </p>

<p>data.txt looks like this</p>

<pre><code>a   New York    5    7   9
b   Virginia    10   2   5
c   Los Angeles 25   15  6
</code></pre>

<p>Here is my code:</p>

<pre><code>   int main()
   {
    string city;
    double price;
    int amt1, amt2, amt3;
    char orderStatus;

    ifstream warehouse;
    ofstream output;
    warehouse.open("data.txt");
    output.open("dataOut.txt");

    while (warehouse.good()) 
    {
        warehouse &gt;&gt; orderStatus;
        output &lt;&lt; orderStatus &lt;&lt; "\t";

        getline(warehouse, city, '\t');
        //warehouse &gt;&gt; city;
        output &lt;&lt; city &lt;&lt; endl;

        //warehouse &gt;&gt; amt1;
        //output &lt;&lt; amt1 &lt;&lt; "\t";

        //warehouse &gt;&gt; amt2;
        //output &lt;&lt; amt2 &lt;&lt; "\t";

        //warehouse &gt;&gt; amt3;
        //output &lt;&lt; amt3;
    }


    warehouse.close();
    output.close();

    return 0;
   }
</code></pre>

<p>Thanks for your much need help.</p>
