I need your help. I have a text file which i include in the message. As you can see this is a log file, now the problem is that i want to seperate each test that start with @Start......@ ..... and ends with @End.....@ and after that i want to put each value on differents arrays.
example.
Start State Reaction End State Time Stamp
1 1 3 0,030
3 3 5 0,060
etc.
I have write a code looks like this (this is a sample of the code):
Code:
Public Sub Simple_Reaction_Time_Shape()
Dim ac As Single
Dim bc, dc As Single
Dim i As Integer
Open App.Path & "\" & "SimpleReactionTimeShapeTemp.ini" For Output As #2
Do While Not EOF(1) And Left(Fline, 26) <> "@Simple_Reaction_Time_End@"
bc = ac
Line Input #1, Fline
If Left(Fline, 13) = "Start State: " Then
Start_State = Val(Right(Fline, Len(Fline) - 13))
Line Input #1, Fline
Event_State = Val(Right(Fline, Len(Fline) - 10))
Line Input #1, Fline
End_State = Val(Right(Fline, Len(Fline) - 11))
Line Input #1, Fline
ac = Val(Comma2Dot(Right(Fline, Len(Fline) - 11)))
End If
' Add ac, r, es, ss Format(A(9), "#0.###")
dc = ac - bc
dc = Format(dc, "#0.###")
i = i + 1
Debug.Print i, Cand_Number, Left_Hand, Right_Hand, Date_Exam, Test_Name, Start_State, Event_State, End_State, ac, dc
Print #2, i & "." & Cand_Number & "." & Left_Hand & "." & Right_Hand & "." & Date_Exam & "." & Test_Name _
& "." & Start_State & "." & Event_State & "." & End_State & "." & ac & "." & dc
Loop
Close #2
End Sub
but i have a lot of problem because each test is difference.
Thanks in advance for any help.
Private Sub cal_but_Click()
Dim sText, pos1, pos2
Dim I
Dim CompareString1, CompareString2 As String
Dim Number As Long
FFile = FreeFile
If List1.ListIndex <> -1 Then
Text38.Text = List1
Open Dir1.Path & "\" & List1.Text & ".txt" For Input As #FFile
sText = Input(LOF(1), #FFile)
Close #FFile
and this is the stiring:
@Simple Reaction Time@
0,02
Start State: 1
Reaction: 0
End State: 1
Time Stamp:0,017
Start State: 1
Reaction: 1
End State: 3
Time Stamp:50,892
.
.
@Simple_Reaction_Time_End@
@Simple Reaction TIME Sound@
Start State: 1
Reaction: 0
End State: 1
Time Stamp:0,017
Start State: 1
Reaction: 1
End State: 3
Time Stamp:50,892
.
.
.
@Simple_Reaction_Sound_End@
@Reaction_Time_Position_Start@
Start State: 1
Reaction: 0
End State: 1
Time Stamp:0,017
Start State: 1
Reaction: 1
End State: 3
Time Stamp:50,892
.
.
@Reaction_Time_Position_End@