Some help on parsing text files

Old posts that have not been replied to for several years.
Locked
User avatar
Aron
Halfop
Posts: 86
Joined: Sat Mar 15, 2003 8:35 am

Some help on parsing text files

Post by Aron »

Im planning to write a script that parses an automatically generated text/xml file, which contains information about certain events on a gameserver.
It should contain information about the time, date, number of people allowed, server, etc.

I guess this can be done by searching for certain strings, which contain the info, something like this:

Code: Select all

<event name="eventnamehere" server="theserver" numberofpeople="x" etc,>
Now, my question is, are there any tutorials about text parsing, or could someone please briefly explain to me how i could do this?

Thanks in advance
The best way to start learning is to start helping.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

There are a few XML tools about for Tcl.

http://resource.tcl.tk/resource/software/tools/xml/

More specificaly

http://www.proprius.co.uk/resources/sxml_home.htm

This is a all Tcl XML parser.
User avatar
Aron
Halfop
Posts: 86
Joined: Sat Mar 15, 2003 8:35 am

Post by Aron »

thanks! :)
The best way to start learning is to start helping.
Locked