我有一个属性文件,我需要从中提取一些特定的属性行:
我的属性文件内容是:
datahelper.SecLegalAgreementParty.queryAttributes = type=DataProcessorHelper, contextType=REFERENCE, dataSource=CIT, dataSubType=SecLegalAgreementParty
datahelper.SecLegalAgreementParty.indexes = agreementIdPartitionIdClientId
datahelper.SecLegalAgreementParty.index.agreementIdPartitionIdClientId.columns=agreementID, partitionID, clientID
datahelper.CITPricerOverrideByTrade.queryAttributes = type=DataProcessorHelper, contextType=REFERENCE, dataSource=CIT, dataSubType=PricerOverrideByTrade
datahelper.CITPricerOverrideByTrade.preload = true
datahelper.CITCrisiDerivativePosition.queryAttributes = type=DataProcessorHelper, contextType=CALC, dataSource=CIT, dataSubType=Exposure, dataProcessorHelperType=result, CanonicalClassName=com.jpmorgan.gcrm.calc.crisi.deriv.common.data.result.CECrisiDerivativePosition
datahelper.CITCrisiDerivativePositionCalcMetricResult.queryAttributes = type=DataProcessorHelper, dataSource=CIT, dataSubType=Exposure, dataProcessorHelperType=result, CanonicalClassName=com.jpmorgan.gcrm.calc.crisi.deriv.common.data.result.CECrisiDerivPsnCalcMetric
我只需要提取所有属性,我们可以在同一个表达式中datahelper.{anything}.queryAttributes
省略属性吗?CanonicalClassName=
我的代码是这样的:
for line in file:
if re.match("^[datahelper.CIT]", line, False):
print line
请协助。
谢谢