473,387 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Load a text file in a Listview

Hi Everyone,
I try to load a text file into a listview.
Here is my text file:
10
"Babar"
9
6
15
"Robert"
3
7

I want:
Line 1 in column 1
Line 2 in column 2
Line 3 in column 3
Line 4 in column 4
Line 5 in column 1
Line 6 in column 2
Line 7 in column 3
Line 8 in column 4
etc...

I don't know how to do it ...
Please help me.

Rita

Apr 20 '07 #1
1 4348


"mr*****@hotmail.com" wrote:
Hi Everyone,
I try to load a text file into a listview.
Here is my text file:
10
"Babar"
9
6
15
"Robert"
3
7

I want:
Line 1 in column 1
Line 2 in column 2
Line 3 in column 3
Line 4 in column 4
Line 5 in column 1
Line 6 in column 2
Line 7 in column 3
Line 8 in column 4
etc...

I don't know how to do it ...
Please help me.

Rita
Hi Rita,

I'am assuming you have the column headers or whatever defined in
designer mode...

Dim LItem As New ListViewItem
LItem = New ListViewItem

' Loop Through Data File
'First Column
LItem.Text = "Line1 in Data File"
'Add subitems
LItem.SubItems.Add("Line2 in Data File")
LItem.SubItems.Add("Line3 in Data File")
LItem.SubItems.Add("Line4 in Data File")
'continue with reading data file .... and adding to listview
columns
......
'Now post the first ListView Row With the Item And Sub-items
ListView1.Items.Add(LItem)

Hope this helps. Leo

Apr 20 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Roy Riddex | last post by:
I have a text file which holds data for 30 cars in the following way: CarRegistration CarType CarClass Available I'm trying to display the full contents of this...
60
by: Julie | last post by:
What is the *fastest* way in .NET to search large on-disk text files (100+ MB) for a given string. The files are unindexed and unsorted, and for the purposes of my immediate requirements, can't...
4
by: Husam | last post by:
Hi EveryBody: How can I load data from text file to textBox ? any help will be appreciated regard's Husam
5
by: Gaurav - http://www.gauravcreations.com | last post by:
what is the fastest method to sort and load 1 lakh + strings in a list box from a text file. each string is in a new line -- Gaurav Creations
14
by: Ilias Lazaridis | last post by:
within a python script, I like to create a collection which I fill with values from an external text-file (user editable). How is this accomplished the easiest way (if possible without the need...
2
by: jzheng22 | last post by:
Hi all, I am new to VB .NET. I am currently wring a simple GUI, a TextBox (multilined), a button and an OpenFileDialog. When user click the button, the OpenFileDialog fired and after user...
1
by: Dragan Ristic | last post by:
Can any one tell how can I load text from log file (.log, .txt) in ListView control (Details view). I have log file like this: Date and Time ; User Name ; Some event Date and Time ; User Name ;...
14
by: mfrsousa | last post by:
hi there, i have a huge large text file (350.000 lines) that i want to import to a MS Acccess Database, of course i don't want to use Access, but do it with C#. i already have tried the...
2
by: Poten Tate | last post by:
Does anyone know a simple way to load a text file into an html file? I know how to do it with server side includes. But you have to name the file with a 'shtml' extension and this creates a problem...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.