[Tutor] How to parse and extract data from a log file?

Alan Gauld alan.gauld at btinternet.com
Wed Aug 8 02:18:42 CEST 2007

"Tim Finley" <gofinner at hotmail.com> wrote

> but I thought a practical way of learning it would be to create a 
> script.

Yep, its a good start once you've been through the language
basics in a tutorial.

> ....  There are two lines containing this information for each user. 
> I
> want to find the two lines for each user and place the information 
> in a
> different file.  I can't figure out how to find the information I'm 
> after.

Look at the Handling Files and Handling Text topics in my tutorial.
You may need to look at the Regular Expressions topic too if the
patterns are complex.

In particular look at the "Practical example" in the regex topic.

Once you have a specific question or an error merssage come
back here and we'll take it from there...


Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list