I have a large log file. Every minute I add recent activity of the OS. It looks like:
#@#@#@#@#@#@#@
Time:12:00 PM, CPU:12.0,RAM:12334321,Network:1231231233,....
#@#@#@#@#@#@#@
Time:12:01 PM, CPU:14.0,RAM:12354621,Network:1239864833,....
#@#@#@#@#@#@#@
Time:12:02 PM, CPU:9.0,RAM:12398781,Network:1231598697,....
#@#@#@#@#@#@#@
I used "#@#@#@#@#@#@#@" as the separator. every time I open the file and write (add) the current status and then close it.
To calculate some of the parameters I need to know what was the last situation of the system, so I need to open the file and read the file in reverse until I reach the separator (#@#@#@#@#@#@#@). How can I read the file in reverse till specific character which in my case is the seperator (#@#@#@#@#@#@#@) and put it (the last records of OS) into a list or tuple.
Thanks!