Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Here's some inspiration for you:
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
from collections import namedtuple
ntrow = namedtuple('ntrow', "f0, f1, mydata, f3")
with open('data.log', 'r') as f:
for line in f:
splitted = line.strip().split(', ')
if len(splitted) == 4:
entry = ntrow(*splitted)
if entry.mydata.isdigit():
print int(entry.mydata)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question