Hi there,
this is my first post here and i hope that im in the right place.
as the thread's title explains (at least i hope it does) im trying to analyze a string and filter out valuable data from a Cardrooms Client logfile
- to get precise:
say i'm playing 8 tables online poker
everytime i get dealt into a hand, a log-entry including my cards and the table is made.
everytime i throw a hand away, its written into the log as well -
to get overview about the tables, i need to "read" the logfile and associate it to open tables, so that i know how many and what hands im actually in and at what tables aso..
atm im using something like
for (int i = 0; i < 99999999; i++)
{
StreamReader r = new StreamReader();
string line = r.ReadLine();
if (line.StartsWith("BLABLA"))
{doBlaBla();}
else if (line.StartsWith("BlubBlub")
{you know where this is going...}
.
.
}
...
this way i had some problems regarding my results (idk why yet..my fault obv) and the speed (with like 100k+ lines its getting laggy to re-read it every seconds..
plus: the info i need is always at the end of the logfile.. so its "wasted time" to check the whole thing over and over again
what i need now is some feedback on:
- have you ever had a similar project, how did you solve it?
- how should i store the filtered information? (atm i use a list with strings of "table,cards,position".. but the string.StartsWith method doesnt like me
- should i maybe first check the open tables and then read the log? (more or less a self-answered quest.)
- anything else that comes to your mind?^^
its the second time ever im writing in C# so i dont know what it's capacities are
i know this is no conventional thread but my brain needs some punshes to get back to the top ^^
usually this should be a problem of a hundred lines of code but im struggling the last 3 days to make this :S (maybe thats the problem.. im too overthinkin by now)
Every answer would be great! Im gettin more and more crazy every second :)
best regards
~ dani sahne