ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eduardo Andrés Alfonso Sierra <>
Subject Re: Reading and Writing of String
Date Sun, 01 Aug 2004 18:18:43 GMT
I would do it like this (however, other solutions must exist and could be
better, this is just my way)

load the properties file using

        <property file=""/>

now you can access the value of you build-date property this way


then you can use replaceregexp to change the value of the version_Date
variable within the java file

        <replaceregexp  file="javaFile">
                <regexp pattern="String version_Date=(.*?);"/>
                <substitution expression="String

This way could work, I think you can easily adapt it to you case.

----- Original Message ----- 
From: "Pritesh saharey" <>
To: <>
Sent: Sunday, August 01, 2004 11:52 AM
Subject: Reading and Writing of String

> Hi All,
>        I need a help regarding reading and writing to a file. There is a
file which looks something like this
>        build-date= AmarGeet_0098_20040812
>        now i want to read this value of variable 'build-date' and write it
to a 'String' variable in a java file
>        String version_Date="";
>        and this process has to be done before the compliation of java
files, is there any way in ant to do this process.
>        so what need to be done here can anybody help me out, I will be
thankful to you.
> Pritesh Saharey
> BE(Mech)
> <a href="">Software</a>
> _____________________________________________________________
> Join Community  --->
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message