davesmith202
Employee of Access World
- Local time
- Today, 22:13
- Joined
- Jul 20, 2001
- Messages
- 522
I have some code that parses up to a million lines of data and its pretty slow. So, using the genius minds on Access Word forums, could some bright spark tell me if my code is optimum for speed or could I change it to be faster? Below is the main batch of code in my loop. Last time I ran it, it took 10 hours to parse the data!
Thanks,
Dave
Thanks,
Dave
Code:
If InStr(var(i), "[Event ") > 0 Then rs!Event = var(i)
If InStr(var(i), "[Site ") > 0 Then
rs!Site = var(i)
rs!SiteClean = Replace(Mid(var(i), 8), """]", "")
End If
If InStr(var(i), "[Date ") > 0 Then rs!DateField = var(i)
If InStr(var(i), "[Round ") > 0 Then rs!Round = var(i)
If InStr(var(i), "[White ") > 0 Then
rs!White = var(i)
rs!WhiteClean = Replace(Mid(var(i), 9), """]", "")
End If
If InStr(var(i), "[Black ") > 0 Then
rs!Black = var(i)
rs!BlackClean = Replace(Mid(var(i), 9), """]", "")
End If
If InStr(var(i), "[Result") > 0 Then
rs!result = var(i)
Select Case var(i)
Case "[Result ""1-0""]"
rs!ResultClean = "1-0"
Case "[Result ""0-1""]"
rs!ResultClean = "0-1"
Case "[Result ""1/2-1/2""]"
rs!ResultClean = "1/2-1/2"
Case "[Result ""1/2""]"
rs!ResultClean = "1/2-1/2"
End Select
If InStr(var(i), "[WhiteELO ") > 0 Then rs!WhiteELO = var(i)
If InStr(var(i), "[BlackELO ") > 0 Then rs!BlackELO = var(i)
End If
If InStr(var(i), "[ECO") > 0 Then
rs!ECO = var(i)
rs!ECOclean = Mid(var(i), 7, 3)
End If
If InStr(var(i), "[PlyCount") > 0 Then rs!PlyCount = var(i)
If InStr(var(i), "[EventDate") > 0 Then rs!EventDate = var(i)