zhb12810
New member
- Joined
- Oct 24, 2012
- Messages
- 3
- Programming Experience
- Beginner
Hi,
I have the following basic code that extracts all the data from a text file and deposits it into a listbox (zMailbox is declared at the top of the class)
The information contained in the text box looks like this...
Unit Name =
Unit Code =
Operation =
Requirements =
Last Audit Date =
Last Auditor =
Date Planned =
Within the folder that text file is located there could be up to 20 different text files but with differing data. What I'm struggling with is adapting the code to look through all the text files and if the line "Date Planned = " matches the date selected from a date picker then to copy and append the information after the "=" on the lines Unit Code, Unit Name, Operation and apply to the listbox
Any advice would be gratefully received
Thanks in advance
I have the following basic code that extracts all the data from a text file and deposits it into a listbox (zMailbox is declared at the top of the class)
VB.NET:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim oReadMenuFunction As System.IO.StreamReader
oReadMenuFunction = IO.File.OpenText(zMailbox)
Do While oReadMenuFunction.Peek <> -1
Dim LineIn As String = oReadMenuFunction.ReadLine()
ListBox1.Items.Add(LineIn)
Loop
End Sub
The information contained in the text box looks like this...
Unit Name =
Unit Code =
Operation =
Requirements =
Last Audit Date =
Last Auditor =
Date Planned =
Within the folder that text file is located there could be up to 20 different text files but with differing data. What I'm struggling with is adapting the code to look through all the text files and if the line "Date Planned = " matches the date selected from a date picker then to copy and append the information after the "=" on the lines Unit Code, Unit Name, Operation and apply to the listbox
Any advice would be gratefully received
Thanks in advance