Skip to content
Advertisement

Split blf-files in Python into smaller files

I’m wondering if it is possible to split BLF-files in Python? I know that there is a library (can) that supports BLF-files, but find no documentation on how to split/save. I can read a BLF-file with:

JavaScript

Would appreciate any help if anybody has knowledge in how I would split this file, and save it into smaller blf-files.

Advertisement

Answer

You can read your logfile and write all messages to new files, changing file every N messages (in my example N=100, which is very low). I find it very useful to look at the doc, otherwise I wouldn’t know how to resume iteration over log_in (in this case as a generator) or how to easily get object_count:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement