16,018,653 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Hacko123 (Top 3 by date)
Hacko123
23-Apr-16 20:42pm
View
how to make it read and apply this for each line and apply the rules for each line?
example of the text file i open and read below:
<line1> d1err./ error on machine
<line2> d1jam./ jam on machine
<line3>d1spe./
<line4>d2err./
<line5>d2jam./ jam on machine
<line6>d2spe./ machine needs maintenance
much appreciated
Hacko123
23-Apr-16 17:10pm
View
thanks for the help I took your advise and this is how it looks
'Each type of Message sent
Dim type1 As String = "d1err./"
Dim type2 As String = "d1jam./"
Dim type3 As String = "d1spe./"
Dim type4 As String = "d2err./"
Dim type5 As String = "d2jam./"
Dim type6 As String = "d2spe./"
<pre>
Dim fileReader As StreamReader = My.Computer.FileSystem.OpenTextFileReader("C:\\locatin1\\filetoshow.txt")
Dim stringReader As String = fileReader.ReadLine()
While stringReader <> Nothing
Dim LineStart As String = stringReader.Substring(0, 7)
Dim RestOfLine As String = stringReader.Substring(7)
' Perform your processing here...
If LineStart = type1 Then
Display1.Dis1RTB1.Clear()
Display1.Dis1RTB1.Text = RestOfLine
ElseIf LineStart = type2 Then
Display1.Dis1RTB2.Clear()
Display1.Dis1RTB2.Text = RestOfLine
ElseIf LineStart = type3 Then
Display1.Dis1RTB3.Clear()
Display1.Dis1RTB3.Text = RestOfLine
ElseIf LineStart = type4 Then
Display2.Dis2RTB1.Clear()
Display2.Dis2RTB1.Text = RestOfLine
ElseIf LineStart = type5 Then
Display2.Dis2RTB2.Clear()
Display2.Dis2RTB2.Text = RestOfLine
ElseIf LineStart = type6 Then
Display2.Dis2RTB3.Clear()
Display2.Dis2RTB3.Text = RestOfLine
End If
stringReader = fileReader.ReadLine()
End While
fileReader.Close()
Last 2 questions
1. will this read each line and apply the rules for each line?
example of the text file i open and read below:
<line1> d1err./ error on machine
<line2> d1jam./ jam on machine
<line3>d1spe./
<line4>d2err./
<line5>d2jam./ jam on machine
<line6>d2spe./ machine needs maintenance
much appreciated
Hacko123
23-Apr-16 17:08pm
View
thanks!