#include #include #include #include using namespace std; int GetIntVal(string strConvert) { int intReturn; intReturn = atoi(strConvert.c_str()); return(intReturn); } int main(int argc ,char* argv[]){ string line1; ifstream myFile(argv[1]); if(! myFile){ cout << "Error opening file" << endl; return -1; } while(! myFile.eof()){ getline(myFile, line1); string r1 = argv[2]; string r2 = argv[3]; int range1 = GetIntVal(r1); int range2 = GetIntVal(r2)- range1; cout << ">Sample Sequence" << endl; cout << line1.substr(range1,range2) << endl; } myFile.close(); return 0; }