Advertisement

TrimwebsolutionsTrimwebsolutions

Problem and Solutions

Python script for log parsing [closed] in python ?

By M.K. Verma · 3 May 2022

Python script for log parsing [closed] in python ?

You're not opening the file like you think you are.

Instead of your current file_text = open(..., Use the following for best results:

with open(log_file, 'r', encoding='utf8') as f:
    file_text = f.readlines()