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

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: 39540
778
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's just like a fortune cookie, but instead of a cookie, it's pie. And we'll call it ... tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!