I have an RFID timing system that returns race finishers via a line in a text file. Lets call that text file "raw reads". Each participant is read at least once but usually several times due to the fact that there are several finish line mats, each with it's own reader.
I have written code to parse that data into an array (basically pulling out their best time and their bib number), shown in a list box. At this point I send that to a sql server database that collects the other information about each participant (name, gender, age, etc). This works fine, but...
Since I refresh this array multiple times during the race, and some races get pretty big (several thousand runners), I would like to not have to go back and get all data from the "raw reads" text file. I would like to just pick up where I left off. How can I do that?
Here is the code I use to get the data from the "raw reads" text file:
k = 0
If Not sRFIDFile = vbNullString Then
frmRFID2.lstRawData.AddItem "NO" & vbTab & "DATA"
iFileNum = FreeFile()
Open sRFIDFile For Input As iFileNum
sFileData = Input(LOF(iFileNum), #iFileNum)
LineArr = Split(sFileData, vbCrLf)
sFileData = vbNullString
For i = 0 To UBound(LineArr) - 1
strFields = Split(LineArr(i), ",")
sThisLine = LineArr(i)
sThisBib = strFields(1)
sThisChip = strFields(2)
sThisTime = strFields(3)
If Len(sThisBib) <= 4 Then
sThisTime = Replace(sThisTime, """", "")
sngThisTime = ConvertToSeconds(sThisTime)
iThisBib = CInt(sThisBib)
If sngThisTime > sngStartTime + sngMinTime Then
RawRslts(0, k) = k + 1
RawRslts(1, k) = sThisBib
RawRslts(2, k) = sThisTime
RawRslts(3, k) = sThisChip
frmRFID2.lstRawData.AddItem k + 1 & vbTab & LineArr(i)
k = k + 1
Any suggestions on how to better manage this process would be much appreciated.
Note: I have set the RawRslts array dim at 11000 to avoid any ReDim Preserve issues. Is there a better way to do that?