I'm currently trying to read a game-log file. I'd like to store the "newest" part / the newly added part of the file in a String without loading the entire file, because that would cause a lot of RAM and CPU usage to process. I've tried multiple solutions like loading every line in an ArrayList<String>
, or loading the entire file and creating a substring without the "checked" part. As I said that's not a suitable solution if the file is too large (up to millions of lines). Any ideas?
Log.txt contains at 9:00:00am:
[LOG\OUTPUT] test1
[LOG\OUTPUT] test2
[LOG\OUTPUT] test3
[LOG\OUTPUT] test4
Log.txt contains at 9:00:01am:
[LOG\OUTPUT] test1
[LOG\OUTPUT] test2
[LOG\OUTPUT] test3
[LOG\OUTPUT] test4
[LOG\OUTPUT] test5
[LOG\OUTPUT] test6
I'd like to get:
[LOG\OUTPUT] test5
[LOG\OUTPUT] test6