Create a gist now

Instantly share code, notes, and snippets.

@Yardanico /test.nim
Last active Oct 12, 2017

What would you like to do?
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