473,385 Members | 1,813 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,385 software developers and data experts.

Separating text from .txt into colums in listview (VB.net mobile)

1
Hey guys.

I want to separate each text into their own Column in VB.net.

How do I achieve this?

Screenshot:



Each entree is seperated with "|" . My Code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub MenuItem3_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem3.Click
  2. Dim folder As String = Environment.GetFolderPath(Environment.SpecialFolder.Personal)
  3. Using sw As StreamWriter = File.AppendText("\My Expenses.txt")
  4.  
  5. sw.WriteLine(DateTimePicker.Text + Space(1) & "|" & Subject.Text + Space(4) & "|" & Category.Text + Space(5) & "|" & Amount.Text + Space(4) & "|" & Peyment.Text)
  6. sw.Close()
  7. End Using
  8. End Sub
  9.  
Apr 15 '12 #1
1 2274
MrMancunian
569 Expert 512MB
Basically, you need to find out how the text is in the text-file. If it's line by line, you just start reading lines till EOF (End of File) and split each line on the character "|". You put them all in an multidimensional array so it looks like this:

Expand|Select|Wrap|Line Numbers
  1. [0][Date]
  2. [0][Subject]
  3. [0][Category]
  4. [0][Amount]
  5. [0][Payment]
  6. [1][Date]
  7. [1][Subject]
  8. [1][Category]
  9. [1][Amount]
  10. [1][Payment]
The first column in your array is the line, the second contains the values you read from your textfile.

After that, it's just a matter of inserting your array in your table.
Apr 18 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: juli jul | last post by:
Hello, I have a class which emplements the list view (the cell in a list view is a text box) Each cell content generated by the item of the list view. The problem is how to adjust the size of the...
4
by: Tee | last post by:
Hi, Need some help with listview, is there a function that can search the listview for a specified string and return true/false ? Thanks, Tee
2
by: Maarten | last post by:
how can i retrieve the text of an item(first column) in a listview when i check the checkbox. the index is no problem, but the text isn't. thanks Maarten
0
by: Lucky | last post by:
hi guys, i'm looking for a soultion that helps me to show the subitem text of the listview control in the tooltip when the mouse pointer hovers on the subitem. i've found on solution, according to...
10
by: Petr Jakeš | last post by:
I have a standard 12-key mobile phone keypad connected to my Linux machine as a I2C peripheral. I would like to write a code which allows the text entry to the computer using this keypad (something...
0
by: Tristan | last post by:
I have a ListView control with one column. It is in the Details view mode. I populate its items dynamically. Some items will have associated images from the listview's imagelist and some will...
11
by: jw01 | last post by:
Hi, I have created a text widget with multiple text fields using Perl Tk. So its like a web form e.g Name: (user entered xyz) Address:(user entered 123) Age:(user entered 77) When a user...
0
by: Gary Brown | last post by:
Hi, I have implemented Cut item in a ListView with Ctl-X as the shortcut key. Unfortunately this supercedes Ctl-X when used to edit a label. What is the easiest way around this? The Ctl-X is...
7
by: Pantokrator | last post by:
Hi, I've searched the web and MSDN but couldn't find adequate information on retrieving the text of a subitem of a listviewitem. What I want to do is simple. I have a listview control with 2...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.