devDevil
Erfahrenes Mitglied
Könnte mir vorstellen, dass das geht ![Wink ;) ;)](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f609.png)
... hab es aber nicht ausprobiert ![Big grin :D :D](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f600.png)
![Wink ;) ;)](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f609.png)
C++:
#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
#include <iterator>
#include <cstring>
struct helper
{
std::string data;
helper(std::string const& data) : data(data) {}
operator const char*() const { return &data.c_str()[20]; };
friend std::ostream& operator<<(std::ostream& out, helper const& data)
{ return out << data; }
};
int foo()
{
std::ifstream file_stream_read("C:\\Dokumente und Einstellungen\\User\\Eigene Dateien\\trace.0");
if (!file_stream_read) { std::cerr << "FEHLER: Trace-File could not be opened!" << std::endl; return 1; }
std::string line;
std::vector<helper> data;
while (std::getline(file_stream_read, line))
if (line.find("request 22") != std::string::npos || line.find("response 62") != std::string::npos)
data.push_back(helper(line));
std::sort(data.begin(), data.end(), std::strcmp);
std::ofstream file_stream_save("C:\\Dokumente und Einstellungen\\User\\Desktop\\encrypt.txt");
std::copy(data.begin(), data.end(), std::ostream_iterator<helper>(file_stream_save, "\n"));
std::cin.ignore();;
}
![Big grin :D :D](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f600.png)