Over the past couple weeks I've been trying to reaquaint myself with VB.NET. Currently I'm trying to develop a program that will reference the fourth letter (which ranges from numbers 1 to 7) within each line of a RichTextBox and pull the information into another RichTextBox. The idea is to hard code each option, giving seven choices for the user to select from a drop down menu. Using Excel is not an option for at this point because the log that I'm pulling the information from is roughly 500k+ rows.
Primary objectives that I'm trying to gain:
First: Display the original user selected file within RichTextBox1. (This part is completed)
Second: From the user selecting a given option, display the modified information within RichTextBox2.
Sample information to be sorted:
<167>Jul 07 2005 22:58:34: %PIX-7-710005:
<163>Jul 07 2005 22:58:37: %PIX-3-106011:
<164>Jul 07 2005 22:58:37: %PIX-4-106023:
Open File Code:
I'm sure there has to be a better way to do this, so any advice for the current route that I'm taking, or any suggestions on another way to go are greatly appreciated.
Primary objectives that I'm trying to gain:
First: Display the original user selected file within RichTextBox1. (This part is completed)
Second: From the user selecting a given option, display the modified information within RichTextBox2.
Sample information to be sorted:
<167>Jul 07 2005 22:58:34: %PIX-7-710005:
<163>Jul 07 2005 22:58:37: %PIX-3-106011:
<164>Jul 07 2005 22:58:37: %PIX-4-106023:
Open File Code:
Code:
Public Sub mnuFileOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuFileOpen.Click
Try
With OpenDialog1
.Filter = "Text files (*.txt)|*.txt|" & "All files|*.*"
If .ShowDialog() = DialogResult.OK Then
FileName = .FileName
sr = New StreamReader(.OpenFile)
RichTextBox1.Text = sr.ReadToEnd
End If
End With
Catch es As Exception
MessageBox.Show(es.Message)
Finally
If Not (sr Is Nothing) Then
sr.Close()
End If
End Try
End Sub