Suppose I have a text file like the one given below.
EVENTS 16623232889 {"log": "Hello I am someone", "stream": "a", "cluster-name": "432"} 3232
EVENTS 16623232890 {"log": "I am doing something.", "stream": "b", "cluster-name": "432"} 2321
EVENTS 16623232891 {"log": "bbye", "stream": "c", "cluster-name": "432"} 231231
EVENTS 16623232892 {"log": "bbyee", "stream": "d", "cluster-name": "432"} 23123212
I want to just get the words which are present in the log. For example the output should be Hello I am someone I am doing something. bbye bbyee
I do know that I can remove the event and event number using the code given below but not sure how to go ahead with it now
file_name = "a.json"
with open(file_name) as f1:
lines = f1.readlines()
for i, line in enumerate(lines):
lines[i] = line.split(" ", 2)[2]
lines = str(lines)
for i, line in enumerate(lines):
lines[i] = line.split(" ", 2)[2]
lines = str(lines)