How to empty a line in file and write it back to the original position?
<p>I'm able to read a string from a file but I'm having trouble deleting or emptying that string. 
Thanks you for helping and have a great day.</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;map&gt;
#include &lt;string&gt;
#include &lt;cstdlib&gt;
#include &lt;sstream&gt;

using namespace std;

int main() {
    map&lt;string, string&gt; Data; // map of words and their frequencies
    string key;               // input buffer for words.
    fstream File;
    string description;
    string query;
    int count=0;
    int i=0;

    File.open("J://Customers.txt");

    while (!File.eof()) {
        getline(File,key,'\t');
        getline(File,description,'\n');
        Data[key] = description;
    }

    File.close();

    cout &lt;&lt; endl;

    for ( count=0; count &lt; 3; count++)  {
        cout &lt;&lt; "Type in your search query.";
        cin &gt;&gt; query;
        string token[11]; 
        istringstream iss(Data[query]);  
        while ( getline(iss, token[i], '\t') ) {
            token[0] = query;
            cout &lt;&lt; token[i] &lt;&lt; endl;
            i++;     
        }  
    }   
    system("pause");

}//end main
</code></pre>
