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 ?](/_next/image?url=https%3A%2F%2Fserveapi.trimwebsolutions.com%2Fuploads%2Flegacy%2Fblog%2F16515784031651578403.jpg&w=3840&q=65)
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()