我有一本像这样的字典:
{
levels = {
exchange = {
text = ALL;
};
product = {
text = ALL;
};
segment = {
text = ALL;
};
symbol = {
text = ALL;
};
};
marginavailable = {
adhocmargin = {
text = "0.00";
};
branchadhoc = {
text = "0.00";
};
cashmarginavailable = {
text = "0.00";
};
collateralvalue = {
text = "0.00";
};
credits = {
text = "0.00";
};
directcollateralvalue = {
text = "0.00";
};
notionalcash = {
text = 0;
};
payinamount = {
text = "0.00";
};
};
marginutilised = {
adhocscripmargin = {
text = "0.00";
};
category = {
text = 0;
};
cncmarginused = {
text = 0;
};
cncsellcreditpresent = {
text = 0;
};
debits = {
text = "0.00";
};
elm = {
text = "0.00";
};
exposuremargin = {
text = "0.00";
};
grossexposurevalue = {
text = "0.00";
};
ipoamount = {
text = "0.00";
};
mfamount = {
text = "0.00";
};
multiplier = {
text = "0.00";
};
payoutamount = {
text = "0.00";
};
premiumpresent = {
text = "0.00";
};
realisedmtom = {
text = "-0.00";
};
scripbasketmargin = {
text = "0.00";
};
spanmargin = {
text = "0.00";
};
subtotal = {
text = "0.00";
};
turnover = {
text = "0.00";
};
unrealisedmtom = {
text = "-0.00";
};
valueindelivery = {
text = "0.0";
};
varmargin = {
text = "0.00";
};
};
net = {
text = "0.00";
};
}
上面的字典包含四个键,即levels、marginavailable、marginutilised和net等
我希望将前三个键和最后一个对象中的对象放入一个数组中。我已经尝试了很多,但没有找到任何逻辑来解析它。
我想要这样的字典数组
exchange = {
text = ALL;
};
product = {
text = ALL;
};
segment = {
text = ALL;
};
symbol = {
text = ALL;
};
adhocmargin = {
text = "0.00";
};
branchadhoc = {
text = "0.00";
};
cashmarginavailable = {
text = "0.00";
};
collateralvalue = {
text = "0.00";
};
credits = {
text = "0.00";
};
directcollateralvalue = {
text = "0.00";
};
notionalcash = {
text = 0;
};
payinamount = {
text = "0.00";
};
adhocscripmargin = {
text = "0.00";
};
category = {
text = 0;
};
cncmarginused = {
text = 0;
};
cncsellcreditpresent = {
text = 0;
};
debits = {
text = "0.00";
};
elm = {
text = "0.00";
};
exposuremargin = {
text = "0.00";
};
grossexposurevalue = {
text = "0.00";
};
ipoamount = {
text = "0.00";
};
mfamount = {
text = "0.00";
};
multiplier = {
text = "0.00";
};
payoutamount = {
text = "0.00";
};
premiumpresent = {
text = "0.00";
};
realisedmtom = {
text = "-0.00";
};
scripbasketmargin = {
text = "0.00";
};
spanmargin = {
text = "0.00";
};
subtotal = {
text = "0.00";
};
turnover = {
text = "0.00";
};
unrealisedmtom = {
text = "-0.00";
};
valueindelivery = {
text = "0.0";
};
varmargin = {
text = "0.00";
};
net = {
text = "0.00";
};
提前致谢。