Let's say you have a file (file.log) with the content:
Date/Time: 2019-09-11 13:11:48 Global Freq. Table [Ticks @ 82.3045ps] -1215 : 56 -1214 : 192 -1213 : 105 -1212 : 375 -1211 : 230
Date/Time: 2019-09-11 13:11:48 Global Freq. Table [Ticks @ 82.3045ps] -1215 : 56 -1214 : 192 -1213 : 105 -1212 : 375 -1211 : 230
Date/Time: 2019-09-11 13:11:48 Global Freq. Table [Ticks @ 82.3045ps] -1215 : 56 -1214 : 192 -1213 : 105 -1212 : 375 -1211 : 230
First you open the file:
file = open('file.log', 'r')
You read all the lines from the file, and then you close it:
lines = file.read().splitlines()
file.close()
Since the columns are clearly separated by the : character, it's simple to get each column separately:
for line in lines:
if not line:
continue
columns = [col.strip() for col in line.split(':') if col]
# do something
Now the column variable contains all the columns you needed.
regexto extract pattern likeXXX : XXX, you will get 2 groups separated by:, can you try it and update here.