I have textfiles used for printers that are between 4M and 1G: it has very important text right at the end of these files for "no of pages", that we need to extract.
I've got code for Reading a block one big chunk at a time, below
Private Function GetBlock(reader As StreamReader) As String
Dim builder As New System.Text.StringBuilder
Dim buffer(m_BlockSize - 1) As Char
Dim charCount As Integer
'Read the next 4KB of the file.
charCount = reader.ReadBlock(buffer, 0, m_BlockSize)
builder.Clear()
builder.Append(buffer, 0, charCount)
Return builder.ToString()
End Function
I've seen code on the internet to read the blocks from the bottom up, but can't seem to locate it now.
Does anyone know how to read from the bottom up, to save a massive amount of time traversing through files upto 1G of text in size?