int main(int argc, char *argv[]) { ifstream fInput; ofstream fOutput; string sRead; fInput.open(argv[1], ios::in); fOutput.open(argv[2], ios::out); do{ getline (fInput, sRead); if (sRead.find ("Hallo1") !=-1) fOutput << sRead << endl; if (sRead.find ("Hallo2") !=-1) fOutput << sRead << endl; if (sRead.find ("Hallo3") !=-1) fOutput << sRead << endl; }while(!fInput.eof()); fInput.close(); fOutput.close(); return 0;