Jump to content
Sign in to follow this  

Populating a ListBox

Recommended Posts


Hi guys and gals,

I'm trying to populate a ListBox with information taken from a logfile that contains data from 11 fields on a line-by-line basis. e.g.


Agnieszka Gorczynska{TAB}Agnieszka Gorczynska{TAB}8{TAB}2008-01-21 09:53{TAB}{TAB}2008-01-20 14:53{TAB}782{TAB}DWD50JI4.lxw{TAB}6{TAB}unum{TAB}Robert SCOTT{CR}

Agnieszka Gorczynska{TAB}Agnieszka Gorczynska{TAB}9{TAB}2008-01-21 09:53{TAB}{TAB}2008-01-20 14:53{TAB}782{TAB}DWD50JI1.lxw{TAB}1{TAB}unum{TAB}Robert SCOTT{CR}

What i think i should do is split each line of the log into a MDArray , so i would have

........... Line1 Line2 Line3 ... To end of file

Field 1

Field 2

Field 4


Field 11

Or the 'fields' could even run across the top of array with the 'lines' appearing down the side, whatever.

So i can then take all instances of Field2 and place the values into the ListBox...

But then that leads me onto needing to ensure that names are unique... which i'll deal with some other time.

I havent really got any code to show you as im still struggling with the concept, but would a MultiDimensional array be the answer for this or are there better ways to do it?

If so how would i go about populating the array?

Edited by Azazash

Share this post

Link to post
Share on other sites

StringSplit using @TAB as delimiter.


#include <array.au3>
$s = "Agnieszka Gorczynska  Agnieszka Gorczynska    8   2008-01-21 09:53        2008-01-20 14:53    782"
$spl = StringSplit($s, @TAB)

EDIT: removed a small part of testing line because it was being truncated.

You can see that everything is put in an array - it's up to you to continue from here.

Edited by enaiman

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this