Need help with loading text file into ListView (or other)

fiveforty

Newcomer
Joined
Apr 11, 2003
Messages
4
Location
Melbourne, Australia
i'm a beginner vb.net programmer and would like some assistance with loading a txt file into some sort of a list.

What i have is:
a text file with some sort of delimiting method,
eg. firstname|lastname|age|etc...
or firstname:lastname:age:etc..

and i want to load this into some sort of a list with a column for each field, so:

______________________________
| first name | last name | age | etc...
------------------------------------------
nick thomas 34
john doe 23

etc

i currently have FileOpen and LineInput to read the file, but cannot get the fields into the columns in a ListView (i can parse it but don't know how to specify items.add to different columns).

Also how can i take the value of individual columns in a selected row and put them into TextBox 'es like First Name: Last name, etc?

sorry if this problem has been addressed before. any help would be greatly appreciated.

-michael
 
Write a routine that reads one line of text.

And then implement the following pseudocode.

Visual Basic:
Dim myLine as string
Dim myItems() as string 'array

open file

Do While Not file.eof
  myLine = ReadLine
  myItems = split(myLine)
  ... Process Items


Loop
 
Back
Top