I am working to achieve something that lokks really simple , but it actually sint.
I have I text tab delimited file. in every line of that file at the same position in every row of the file I will have a bit that I would want to compare against 23 values (I will call them criteria). So if on every row the string I need matches one of tjhese values then that row will be written in File1.Txt if that value doesn`t match any of the criteria the whole row will be sent to File2.txt.
So far managed to get the original file written in the same format in a newly created file.
I have an idea of how to get the functionality I described working but am stuck with correct syntax.
Here is what I have so far:
Expand|Select|Wrap|Line Numbers
- Dim fs As New FileStream("C:\Original.txt", FileMode.Open, FileAccess.Read)
- RichTextBox1.Text = ""
- Dim d As New StreamReader(fs)
- d.BaseStream.Seek(0, SeekOrigin.Begin)
- While d.Peek() > -1
- Dim s As String = d.ReadLine()
- If s.Length > 1000 Then
- s = s.Remove(1000)
- End If
- RichTextBox1.Text &= s & Environment.NewLine
- End While
- d.Close()
- Dim fs1 As New FileStream("C:\File1.txt", FileMode.Create, FileAccess.Write)
- Dim ss As New StreamWriter(fs1)
- ss.WriteLine(RichTextBox1.Text)
- ss.Close()
- End Sub
I am lost totaly , I have no idea how would that look like.
If someone can help here would be great
Thank you