我正在android中的项目中工作。我有一个这样的文本文件
Timestamp: Friday 12.01.2000 -- 03:50:19
G:0.41, 0.64, 0.0
X:0.15, -0.06, -0.0
Y:-0.34, -0.44, -0.04
我想将其转换为json格式
[ { "created_at": "Friday 12.01.2000 -- 03:50:19",
"field1": 0.41,
"field2":0.15,
"field3":-0.34,
},
{ "created_at": "Friday 12.01.2000 -- 03:50:19",
"field1": 0.64,
"field2":-0.06,
"field3":-0.44,
},
{ "created_at": "Friday 12.01.2000 -- 03:50:19",
"field1":0.0,
"field2":-0.0,
"field3":-0.04,
}]
我不知道如何用Java编辑文本文件。谢谢