I have a file like this and each line contains something like this string:
[{u'text': u'this', u'freq': 1}, {u'text': u'is', u'freq': 1}, {u'text': u'a', u'freq': 1}, {u'text': u'test', u'freq': 1}]
I tried to load each line into json object but I get this error:
for lineid, line in enumerate(open("myfile.txt")):
jsonline=json.loads(line)
I get the following error:
raise ValueError(errmsg("Expecting property name", s, end))
ValueError: Expecting property name: line 1 column 2 (char 2)
I want to retrieve all 'text' from the file and have it in each line. So each line will not be json but will be the sequence of text space separated. Example:
this is a test