Created
March 5, 2021 10:30
-
-
Save xdanielsb/aa8da6de3ba26712c6a002601a3d1fa1 to your computer and use it in GitHub Desktop.
Get timespams log file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<bits/stdc++.h> | |
| using namespace std; | |
| /* | |
| * @author: xdanielsb | |
| * get timestamps log file | |
| */ | |
| int main(){ | |
| ifstream file("redh324-p.log"); | |
| string str; | |
| smatch m; | |
| regex regexp("[0-9]{2}/[a-zA-z]{3}/[0-9]{4}:[0-9]{2}:[0-9]{2}:[0-9]{2}"); | |
| set<string> aux; | |
| while (getline(file, str)){ | |
| regex_search(str, m, regexp); | |
| for (auto x : m) aux.insert(x); | |
| } | |
| for( string x: aux){ | |
| cout << x <<endl; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment