Every time you get a new file, you need to parse the file, keeping track of the FILE OFFSET (it is in the File Handle structure).
Are all the error codes between 0 and 9999? Basically, create a Signed DWORD array 10,000 long, these will store the FILE OFFSET at the INDEX of that block, where the INDEX equals the ERROR CODE.
Say the file is as follows
1, Bad Stuff Happened
9002, Worse Stuff Happened
3, Even Worst Stuff Happened
I am guessing, but assuming CR/LF, the error text for error codes 1, 9002, and 3 would be at index
3 // B Bad...
27 // W Worse...
52 // E Even...
ErrorOffset would be a block, where index of 1, 9002, and 3 would have those values:
ErrorOffset0 0
ErrorOffset1 3
ErrorOffset2 0
ErrorOffset3 52
ErrorOffset4 0
ErrorOffset5 0
ErrorOffset6 0
ErrorOffset7 0
ErrorOffset8 0
ErrorOffset9 0
ErrorOffset10 0
...
ErrorOffset8999 0
ErrorOffset9000 0
ErrorOffset9001 0
ErrorOffset9002 27
ErrorOffset9003 0
...
ErrorOffset9999 0
Then, whenever you get error code, you would do
FILEOPEN
FILESEEK to position ErrorOffset[ErrorCode]
FILEREAD to CR/LF into SL0
FILECLOSE
This is how databases work. They have "index" tables to get to the actual file position quickly.