简体   繁体   中英

Ant script to fetch property value from another property file

I have 2 properties files as below a.properties has list of property names b.proprties has list of its corresponding values

a.properties

Application=

ApplicationID=

BU=

b.properties

ACCSRV

ACCSRV

BT

I am looking for ant script which can give me final properties file with out out as below:

Final.properties:

Application=ACCSRV

ApplicationID=ACCSRV

BU=BT

Sounds like you need an external tool for this. If you can depend on unix tools, you can use the paste command (see man paste ) and run it from ant using the exec task. If not, you can either

  • write the tool in java, then use tasks javac and java to compile and run it from ant
  • or use the script task to embed the tool in your ant script using some scripting language

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM