• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Retrieve keys using values in ANT

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
permaculture is largely about replacing oil with people. And one tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic