Try to use regular expressions to group your text. There are many libraries which give you Reg Exp support. If the text you are looking for always occurs at a certain point in a line, just use the plain getline and then use string apis like strchr and strtok to extract your data.
<br><br>Can you give an example of the text file and the messages you are looking for? Then probably we can you more core info.<br><br>Cheers,<br>Arjun<br><br><div><span class="gmail_quote">On 7/20/07, <b class="gmail_sendername">
Zach</b> &lt;<a href="mailto:netrek@gmail.com">netrek@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I would like to write a parser for a game log file (ASCII text). There
<br>will be many different sorts of text I will need to identify and<br>group. I guess I need first to decide on existing sentinels in the<br>data I can use. I am wondering what would be the best way to find and<br>process the data files. The final output will be a colorized HTML set
<br>of files with frames, one frame corresponding to each of a 4 different<br>message types. A lot of data in the files I will just ignore, I just<br>want basically to extract the messages people type to one another and<br>
to their team, global or personal message boards. So should I just<br>read one line at a time or read chunks?<br>I heard in C there is a couple different ways I could do this task.<br>Any ideas with code snippets or psuedocode would be helpful.
<br><br>Zach<br><br>_______________________________________________<br>This is the Linux C Programming List<br>:&nbsp;&nbsp;<a href="http://lists.linux.org.au/listinfo/linuxcprogramming">http://lists.linux.org.au/listinfo/linuxcprogramming
</a> List<br></blockquote></div><br><br clear="all"><br>-- <br>And it&#39;s whispered that soon, if we all call the tune,<br>Then the piper will lead us to reason<br>And a new day will dawn for those who stand long<br>And the forest will echo with laughter
<br><br><a href="http://freeshells.ch/~phoenix">http://freeshells.ch/~phoenix</a>