Advertisement
Guest User

Untitled

a guest
Jun 18th, 2021
636
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <vector>
  4. #include <string>
  5.  
  6. using namespace std;
  7.  
  8. const string input = "Client.txt";
  9. const string output = "logs.txt";
  10.  
  11. int main()
  12. {
  13.     ifstream In;
  14.     ofstream Out;
  15.     string line = "";
  16.     unsigned int n = 0, n2 = 0;
  17.  
  18.     In.open(input.c_str());
  19.     Out.open(output.c_str());
  20.  
  21.     if (In.fail())
  22.     {
  23.         return 0;
  24.     }
  25.     else
  26.     {
  27.         while (!In.eof())
  28.         {
  29.             getline(In, line);
  30.             if (line.find("Player died,") != -1)
  31.             {
  32.                 int n = line.find("Player died,");
  33.                 line.erase(0, n - 1);
  34.                 Out << line << "\n";
  35.             }
  36.         }
  37.     }
  38.     In.close();
  39.     Out.close();
  40.     cin.get();
  41.     return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement