ndjson

How to parse a string of multiple jsons without separators in python?

How to parse a string of multiple jsons without separators in python? Question: Given a single-lined string of multiple, arbitrary nested json-files without separators, like for example: contents = r'{"payload":{"device":{"serial":213}}}{"payload":{"device":{"serial":123}}}’ How can contents be parsed into an array of dicts/jsons ? I tried df = pd.read_json(contents, lines=True) But only got a ValueError response: ValueError: Unexpected …

Total answers: 1

How to get an unknown substring between two known substrings, within a giant string/file

How to get an unknown substring between two known substrings, within a giant string/file Question: I’m trying to get all the substrings under a "customLabel" tag, for example "Month" inside of …,"customLabel":"Month"},"schema":"metric… Unusual issue: this is a 1071552 characters long ndjson file, of a single line ("for line in file:" is pointless since there’s only …

Total answers: 1