I have a json file containing texts like:
dr. goldberg offers everything.parking is good.he's nice and easy to talk
How can I extract the sentence with the keyword "parking"? I don't need the other two sentences.
I tried this:
with open("test_data.json") as f:
for line in f:
if "parking" in line:
print line
It prints all the text and not that particular sentence.
I even tried using regex:
f=open("test_data.json")
for line in f:
line=line.rstrip()
if re.search('parking',line):
print line
Even this shows the same result.