You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Oscar Farga <os...@mss.es> on 2002/12/05 09:44:19 UTC

Selecting a file

Hi,

 We need to process the "newest" files which names' contain a determined
number of patterns and discard the rest. In example, we have a folder
that may contain several files:

 

EMD_ES_20021201_120301.xml

EMD_ES_20021201_143401.xml

EMD_ES_20021204_120301.xml

OK_ES_20021201_120301.xml

OK_ES_20021201_143401.xml

OK_ES_20021204_120301.xml

 

In this case I would like to process only the EMD_ES_20021204_120301.xml
and  OK_ES_20021204_120301.xml

files. 

What should I use in order to select the file? Regexp?

Thanks

 

Oscar

 

 

 


Re: XML Property handling lists

Posted by Nicola Ken Barozzi <ni...@apache.org>.

Detlef Brendle wrote:
> Hi,
> I would like to use the xmlProperty task to load a list of elements into my
> project.
> The list looks something like:
> 
> A=hello
> A.do=true
> B=world
> B.do=false
> C=foo
> C.do=true
> D=bar
> D.do=true
> ...
> 
> The list is static.
> 
> How would the XML file look like to load this in my project ?

<properties>
   <A do="true">hello</A>
   <B do="false">world</B>
   <C do="true">bar</C>
   <C do="true">bar</C>
   ...

</properties>

IIRC you have to set the collapseAttributes="true" and not set the root 
node to be part of the property name.

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


XML Property handling lists

Posted by Detlef Brendle <de...@canoo.com>.
Hi,
I would like to use the xmlProperty task to load a list of elements into my
project.
The list looks something like:

A=hello
A.do=true
B=world
B.do=false
C=foo
C.do=true
D=bar
D.do=true
...

The list is static.

How would the XML file look like to load this in my project ?

detlef


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Selecting a file

Posted by Oscar Farga <os...@mss.es>.
Thank you Stefan,
 I've downloaded the purge task from www.dallaway.com/ant. I think it
will be of great use.
Best regards,
Oscar


-----Mensaje original-----
De: Stefan Bodewig [mailto:bodewig@apache.org] 
Enviado el: jueves, 05 de diciembre de 2002 10:50
Para: ant-user@jakarta.apache.org
Asunto: Re: Selecting a file

On Thu, 5 Dec 2002, Oscar Farga <os...@mss.es> wrote:

> Is it the only way to create a custom selector?

I think so - alternatively you can do it with <script>.

There has been some discussion on a similar issue on this list that
lead to the <purge> task linked from Ant's "External Tools" page.  You
may find some ideas in <purge>'s code and the discussion leading up to
it (see the archives of this list).

Stefan

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Selecting a file

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 5 Dec 2002, Oscar Farga <os...@mss.es> wrote:

> Is it the only way to create a custom selector?

I think so - alternatively you can do it with <script>.

There has been some discussion on a similar issue on this list that
lead to the <purge> task linked from Ant's "External Tools" page.  You
may find some ideas in <purge>'s code and the discussion leading up to
it (see the archives of this list).

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Selecting a file

Posted by Oscar Farga <os...@mss.es>.
Hi Stefan,
 I don't see how to use these selectors to select the filenames with the
latest timestamps. I figured out how to select the filenames with the
patterns but the problem is I must select only one file, and it must be
the one containing the highest date in the filename. I can't use the
dateselect because I don't know the timestamp that I'm looking for,
there maybe some files with the same date but different times, the
criteria is to get the latest. Is it the only way to create a custom
selector?
Thanks for your help
Regards,
Oscar

-----Mensaje original-----
De: Stefan Bodewig [mailto:bodewig@apache.org] 
Enviado el: jueves, 05 de diciembre de 2002 10:14
Para: ant-user@jakarta.apache.org
Asunto: Re: Selecting a file

<http://jakarta.apache.org/ant/manual/CoreTypes/selectors.html>
<http://jakarta.apache.org/ant/manual/CoreTypes/selectors.html#filenames
elect>
<http://jakarta.apache.org/ant/manual/CoreTypes/selectors.html#dateselec
t>
<http://jakarta.apache.org/ant/manual/CoreTypes/selectors.html#andselect
>

and maybe

<http://jakarta.apache.org/ant/manual/CoreTypes/selectors.html#customsel
ect>

Stefan

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Selecting a file

Posted by Stefan Bodewig <bo...@apache.org>.
<http://jakarta.apache.org/ant/manual/CoreTypes/selectors.html>
<http://jakarta.apache.org/ant/manual/CoreTypes/selectors.html#filenameselect>
<http://jakarta.apache.org/ant/manual/CoreTypes/selectors.html#dateselect>
<http://jakarta.apache.org/ant/manual/CoreTypes/selectors.html#andselect>

and maybe

<http://jakarta.apache.org/ant/manual/CoreTypes/selectors.html#customselect>

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>