这种文件格式叫什么 [英] What is this file format called

查看:84
本文介绍了这种文件格式叫什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要解析以下格式的文件:

I need to parse a file which is in the following format:

"General"
{
"Description" = "Some Text"
"Version" = "4"
"ProjType" = "1"
}
"Configurations"
{
    "Mice"
    {
    "BuildOutputs" = "BuildProject"
    "OutputFile" = "output.txt"
    }
    "Men"
    {
    "BuildOutputs" = "BuildProject"
    "ChangedSinceLastBuilt" = "True"
    }
}

有人知道这是什么文件格式吗?如果众所周知,那么可能已经有库可以帮助解析它.它看起来与JSON类似,但是它使用等号代替冒号,并且使用逗号强制使用新行代替逗号.

Does anyone have any idea what file format this is? If it's well known then there could be already made libraries to help parse it. It appears to be similar to JSON but instead of colons it uses equals sign and instead of commas it forcefully uses a new line.

推荐答案

您可以简单地读取整个文件,然后将=转换为:,并使用,进行每个换行,然后使用-c进行解析现有的json库.也许您必须在数据末尾插入;.

You could simply read in the entire file and then convert = to : and each line break with , - then you could parse it with an existing json library. Perhaps you would have to insert a ; at the end of the data.

这篇关于这种文件格式叫什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆