У меня есть образец строки, мне нужно преобразовать строку в формат JSON. Я пробовал n разными способами, но не смог этого добиться. Было бы здорово, если бы кто-нибудь помог мне построить это. позиция строки образца продолжает меняться, нам нужно выбрать данные на основе присутствующего ключа JSON.
Пример строки:
sample ="The following are the graphical (non-control) characters defined by
ISO 8859-1 (1987). DESCRIPTION : in words aren't all that helpful,
but they're the best we can do in text. A graphics file illustrating
the character set should be available from the same archive as this
file.RESULT :success INTERPRETATION : ISO 8859-1 (1987).CREATED_BY:Questy.CREATED_ON:29/07/1963"
Обязательно JSON вывод
{
"DESCRIPTION":" in words aren't all that helpful but they're the best we can do in text. A graphics file illustrating the character set should be available from the same archive as thisfile",
"RESULT":"success",
"INTERPRETATION":" ISO 8859-1 (1987)",
"CREATED_BY":"Questy",
"CREATED_ON":"29/07/1963"
}