Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Reading properties from another properties file.

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Anybody know how to read a property from one properties file to another properties file?


Cheers,
Manoj.
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure if I am getting your question correctly. In case you are asking


In File 1:
PPTY1=PPTY2
In File 2:
PPTY2=VALUE1


and you want to assign VALUE1 to PPTY1, then you have to use another module/script to do this for you. So for example you can mark your replace-able properties like this:


In File 1:
PPTY1=${PPTY2}
In File 2:
PPTY2=VALUE1


And your script will look for such occurrences to replace. This should be done before you start your actual business related processing.
 
Manoj Maniraj
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Piyush,

Both files are in different locations?
 
Piyush Porwal
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please explain in more detail what are you trying to achieve and if possible some sample code.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic