ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maninder Singh \(GR/EIL\)" <maninder.si...@ericsson.com>
Subject Extracting values from a line of a file
Date Wed, 11 Apr 2007 04:46:39 GMT
Hi,
	I am trying to figure out a way to extract the values from a
line in a file. 

To be more precise; there is a file that contains lines containing the
following fields (separated by spaces / tabs):
Name		Age		Contact_Number

I want to search for a particular name in this file (which I guess can
be done by using the Ant "loadproperties" task) and extract the age
corresponding to that Name from the file. Is there a way to do this?

I was going throught the help for "loadproperties" task and got to know
the following:

"    <loadproperties srcFile="file.properties">
      <filterchain>
        <linecontains
<http://ant.apache.org/manual/CoreTypes/filterchain.html#linecontains> >
          <contains value="import."/>
        </linecontains>
      </filterchain>
    </loadproperties>

Read the lines that contain the string "import." from the file
"file.properties" and load them as Ant properties. "

Can anyone explain how the second value (Age) will be loaded in a
property.

Thanks in advance for your help.

> Regards,
> Maninder Singh

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message