vanquished
Limp Gawd
- Joined
- Oct 29, 2002
- Messages
- 359
Hiya,
Please forgive me if I'm making a fool of myself, I've never really touched VB before until now!
I'm making a program which will display a wind turbine's power output. I'm taking that data from a control box's log file which is, i think a Tab delimited text file. The output of the log is like this:
4.50 WSW 0.27 6.3 WSW
what i've got so far looks like this:
Dim sr As StreamReader = IO.File.OpenText("C:\Users\xxxx\Documents\New Energy Files\weather.txt")
Dim strTemp As String
Dim array(10) As String
Do While sr.Peek <> -1
strTemp = sr.ReadLine
Loop
MsgBox(strTemp(1))
End Sub
What I want the message box to display is 'WSW' but at the moment it displays '.' I have tried to use the split function but it doesn't seem to have any effect! no matter what I put, it seems that 'strTemp' has already been split into single characters. While this does function, 4.5 can sometime become 11.5 and so using the position of the character in the array will not always work.
How can I split strTemp into more than just 1 character?
Please help!
Please forgive me if I'm making a fool of myself, I've never really touched VB before until now!
I'm making a program which will display a wind turbine's power output. I'm taking that data from a control box's log file which is, i think a Tab delimited text file. The output of the log is like this:
4.50 WSW 0.27 6.3 WSW
what i've got so far looks like this:
Dim sr As StreamReader = IO.File.OpenText("C:\Users\xxxx\Documents\New Energy Files\weather.txt")
Dim strTemp As String
Dim array(10) As String
Do While sr.Peek <> -1
strTemp = sr.ReadLine
Loop
MsgBox(strTemp(1))
End Sub
What I want the message box to display is 'WSW' but at the moment it displays '.' I have tried to use the split function but it doesn't seem to have any effect! no matter what I put, it seems that 'strTemp' has already been split into single characters. While this does function, 4.5 can sometime become 11.5 and so using the position of the character in the array will not always work.
How can I split strTemp into more than just 1 character?
Please help!