New parsing post, because the old one wasn't good enough for you
So I need some C++ code to parse a file. I realize the find command works for strings but the file is too large to be loaded into a string.

For example, text.txt reads:

blabababa test
I need something to tell me what character test begins and ends on...so in this case, 11-14. thanks.

Because you people like sample code, here is the main menu preceding the parser:


        #include <iostream>
    #include <fstream>
    #include <string>
    #include <cstdlib>
    #include <ctime>
    #include <iomanip>
    #include <locale>
    #include <sstream>
    using namespace std;
    bool error = false;
    int errors(string high, string low){
        int highint,lowint;
        highint = atoi(high.c_str());
        lowint = atoi(low.c_str());
        //options for error correction
        while (lowint>=highint){
           string answer;
           system("cls");
           cout << "The low C.D.I is equal to or higher than the high C.D.I.\n";
           cout << "The low C.D.I number is " << lowint << "\n";
           cout << "The High C.D.I number is " << highint << "\n" << "\n";
           cout << "What do you want to do?\n";
           cout << "1.Edit the low C.D.I\n";
           cout << "2.Edit the high C.D.I\n";
           cout << "3.Quit\n";
           getline (cin, answer);
           if (answer=="1"){
              cout << "Please re-input the lowest C.D.I number \n";
              getline (cin,low);
              while(low.length()!=7) {
                 cout << "Must be 7 characters\n";
                 cout << "Please re-input the lowest C.D.I number \n";
                 getline (cin,low);
              }
              }
              if (answer=="2"){
                 cout << "Please re-input the highest C.D.I number \n";
                 getline (cin,high);
                 while(high.length()!=7) {
                    cout << "Must be 7 characters\n";
                    cout << "Please re-input the highest C.D.I number \n";
                    getline (cin,high);
              }
              }
              if (answer=="3"){
              error=true;
              return 0;
              }
              highint = atoi(high.c_str());
              lowint = atoi(low.c_str());
        }
    }
    
    int main(int argc, char *argv[])
    {
        //deletes the downloads folder
        system("rmdir downloads");
        //creates a new downloads folder
        system("mkdir downloads");
        //initializes variables
        stringstream ss;
        int highint,lowint;
        string high,low;
      char temp [256];
        stringstream stream;
        // get two values, high and low, pass them as paramaters to java CDIFiller
        cout << "Please input the lowest C.D.I number \n";
        getline (cin,low);
        //checks to make sure length is 7
        while(low.length()!=7) {
            cout << "Must be 7 characters\n";
            cout << "Please re-input the lowest C.D.I number \n";
            getline (cin,low);
            // ... //
        }
        cout << "Please input the highest C.D.I number \n";
        getline (cin,high);
        //checks to make sure length is 7
        while(high.length()!=7) {
                                cout << "Must be 7 characters 7 characters\n";
                                cout << "Please re-input the highest C.D.I number \n";
                                getline (cin,high);
                                }
        highint = atoi(high.c_str());
        lowint = atoi(low.c_str());
        //runs the error check
        errors(high,low);
        //if no errrors are thrown:
        if (error==false){
                      ss << "java CDIFiller "+low+" "+high;
        system( ss.str().c_str() );
        system("PAUSE");
        return EXIT_SUCCESS;
                      }
    }
New parsing post, because the old one wasn't good enough for you
===

So I need some C++ code to parse a file. I realize the find command works for strings but the file is too large to be loaded into a string.

For example, text.txt reads:

blabababa test
I need something to tell me what character test begins and ends on...so in this case, 11-14. thanks.

Because you people like sample code, here is the main menu preceding the parser:


        #include <iostream>
    #include <fstream>
    #include <string>
    #include <cstdlib>
    #include <ctime>
    #include <iomanip>
    #include <locale>
    #include <sstream>
    using namespace std;
    bool error = false;
    int errors(string high, string low){
        int highint,lowint;
        highint = atoi(high.c_str());
        lowint = atoi(low.c_str());
        //options for error correction
        while (lowint>=highint){
           string answer;
           system("cls");
           cout << "The low C.D.I is equal to or higher than the high C.D.I.\n";
           cout << "The low C.D.I number is " << lowint << "\n";
           cout << "The High C.D.I number is " << highint << "\n" << "\n";
           cout << "What do you want to do?\n";
           cout << "1.Edit the low C.D.I\n";
           cout << "2.Edit the high C.D.I\n";
           cout << "3.Quit\n";
           getline (cin, answer);
           if (answer=="1"){
              cout << "Please re-input the lowest C.D.I number \n";
              getline (cin,low);
              while(low.length()!=7) {
                 cout << "Must be 7 characters\n";
                 cout << "Please re-input the lowest C.D.I number \n";
                 getline (cin,low);
              }
              }
              if (answer=="2"){
                 cout << "Please re-input the highest C.D.I number \n";
                 getline (cin,high);
                 while(high.length()!=7) {
                    cout << "Must be 7 characters\n";
                    cout << "Please re-input the highest C.D.I number \n";
                    getline (cin,high);
              }
              }
              if (answer=="3"){
              error=true;
              return 0;
              }
              highint = atoi(high.c_str());
              lowint = atoi(low.c_str());
        }
    }
    
    int main(int argc, char *argv[])
    {
        //deletes the downloads folder
        system("rmdir downloads");
        //creates a new downloads folder
        system("mkdir downloads");
        //initializes variables
        stringstream ss;
        int highint,lowint;
        string high,low;
      char temp [256];
        stringstream stream;
        // get two values, high and low, pass them as paramaters to java CDIFiller
        cout << "Please input the lowest C.D.I number \n";
        getline (cin,low);
        //checks to make sure length is 7
        while(low.length()!=7) {
            cout << "Must be 7 characters\n";
            cout << "Please re-input the lowest C.D.I number \n";
            getline (cin,low);
            // ... //
        }
        cout << "Please input the highest C.D.I number \n";
        getline (cin,high);
        //checks to make sure length is 7
        while(high.length()!=7) {
                                cout << "Must be 7 characters 7 characters\n";
                                cout << "Please re-input the highest C.D.I number \n";
                                getline (cin,high);
                                }
        highint = atoi(high.c_str());
        lowint = atoi(low.c_str());
        //runs the error check
        errors(high,low);
        //if no errrors are thrown:
        if (error==false){
                      ss << "java CDIFiller "+low+" "+high;
        system( ss.str().c_str() );
        system("PAUSE");
        return EXIT_SUCCESS;
                      }
    }