ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Jackson" <foamd...@gmail.com>
Subject Re: Using ant to parse text file
Date Thu, 22 Feb 2007 07:58:30 GMT
> [Sample.txt]
> Test1
> Group=red
>
> Test2
> Group=blue
>
> Test3
> Group=green
>
> Example:- If I was to provide the value "Test2", I would like the Ant to
> search for "Test2" in the file, and return the value "blue". If I provide
> the value - "Test3", it should return the value "green"
>
> Please let me know if there is any simple way of doing this using Ant.

Given that you don't seem to have any more data for each of the Tests
- why don't you just do

Test1=red

then you can use Ant's property task

Even if you are going to group things together you can still use
properties just separate the properties into separate files and then
when you provide Test2, Ant can then lookup the appropraitely names
Test2.properties and then load the values

Unless you want to do something else, I think you want the properties task

Kev

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message