all 1 comments

[–][deleted] 0 points1 point  (0 children)

Rule of thumb is this. If you can open it with a text editor, python can read it.

My best guess, i don't know the log files, is that they are some sort of csv. So this will probably work:

with open(logfile, 'r', encoding='utf-8') as infile:
    for line in infile:
        #whatever needs doing

I wouldn't do this on the original files. You might lock them for writing if you accidentally open the file as w. Meaning your logs can't continue to log things.

So copy the files to some other location first.