Last active
October 12, 2017 15:32
-
-
Save Yardanico/fbb8ab4e6b0a504f7a2ae879afbda05e to your computer and use it in GitHub Desktop.
This file contains 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
import tables, strscans | |
proc readData(path: string): Table[string, string] = | |
result = initTable[string, string]() | |
for line in path.lines: | |
var ip, guid: string | |
var extra: string | |
if scanf(line, "$+ [$+] ($+)", extra, ip, guid): | |
echo "User action: ", ip, " ", guid | |
result[ip] = guid | |
elif scanf(line, "$+ [$+] $+ GUID $+ ", extra, ip, extra, guid): | |
echo "Admin auth: ", ip, " ", guid | |
result[ip] = guid | |
echo readData("tata.txt") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment