I am trying to split a log files into a 2D list. First list splits at every tag and then at the second level it is split at every newline. I get the string and split it to get the first, but when I loop through it to split it again I get the error at the bottom. I have looked and tried different stuff with no luck. It seems right to me but I am fairly new to python.
with open('log.txt', 'r') as f:
read_data = f.read().split('tag: "')
f.closed
for i in read_data:
print read_data[i].split()
Error:
File "parsing.py", line 6, in <module>
print read_data[i].split()
TypeError: list indices must be integers, not str