Dear all,
I have a large (several thousand lines) CSV log file to handle from an SD card, but I just need to check the content of a field (log time) and read a single line (most often it will be the last line). This field contains a time tag (UNIX time) so I know the lines are ordered.
It takes a lot of time if we read and parse the file line by line. I know that there is an extremely fast method to access sorted data (Binary search algorithm - Wikipedia) and I would like to implement it.
I would like to get your advice: what would be the fastest method to access the line I'm looking for?
The total number of lines is unknown, but this is what is known:
- file size
- approximation of average number of characters per line
- data structure (CSV)
I'm using SDFat lib, which contains many methods to access data. Which one is the best? :~
Thanks for your help! ![]()