• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Retrieve keys using values in ANT

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a property file with values as



We are using this file to replace left side string with right side one. However, we are also thinking to use the same property file to replace right side string with left side one.

In ANT Script, is it possible to use a property file both the ways?

Example: I want to replace "abcdef" with %%db_username%%.

and I am currently doing this..



Appreciate any thoughts and help

Thanks
 
author & internet detective
Posts: 39343
755
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not really. A property file is a one way hash. You could write custom code to reverse the format of the property file and put the values first (assuming they meet the definition of keys.) Or you could write custom code to go through all the lines and do the search and replace.
 
Ebenezer Samuel
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jeanne, I am looking to customize this code..

meanwhile, got one more interesting question..

using summary="true" attribute, it displays how many occurrences are replaced in how many files.., is it possible to get detailed summary report redirected to a file? like which file got changed and what is the change made?

Thanks
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!