ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Ivanov <rambiusparkisan...@yahoo.com>
Subject Re: Sorting a property file ?
Date Thu, 24 Mar 2005 11:18:38 GMT
Let's see... This might do the job:
<project>
  <taskdef resource="net/sf/antcontrib/antlib.xml"/>
  <echo file="unsorted.properties">a.name=a
d.name=d
c.name=c
b.name=b</echo>
  <loadfile srcfile="unsorted.properties"
property="unsorted"/>
  <sortlist property="sorted" value="${unsorted}"
    delimiter="${line.separator}"/>
  <echo file="sorted.properties">${sorted}</echo>
</project>

I have posted similar example in [1]. The thread was
started by a developer that wanted to write and
contribute a filter that does the sorting. 

I haven't mastered FilterReaders at that time, but now
I think a sorting FilterReader is the pure Ant way of
doing it.

HTH Ivan

[1]http://marc.theaimsgroup.com/?l=ant-user&m=110061125804348&w=2

--- Nicolas Vervelle <nicolas.vervelle@steria.com>
wrote:
> Ok, thanks
> 
> but I want to sort the property file and save it. Is
> it possible ?
> 
> Nicolas
> 
> Ivan Ivanov wrote:
> 
> >Nicolas,
> >Ant-Contrib has <sortlist> task[1] which can sort
> >properties files.
> >
> >HTH Ivan
> >
>
>[1]http://ant-contrib.sourceforge.net/tasks/tasks/sortlist.html
> >
> >--- Nicolas Vervelle <nicolas.vervelle@steria.com>
> >wrote:
> >  
> >
> >>Hi,
> >>
> >>I have a property file that is generated by
> >><modified> in a <fileset>.
> >>I would like to sort its content so that the files
> >>in it are sorted by 
> >>directory.
> >>Is it possible ?
> >>
> >>Nicolas
> >>
> >>
> >>
> >>
> >>    
> >>
>
>---------------------------------------------------------------------
> >  
> >
> >>To unsubscribe, e-mail:
> >>user-unsubscribe@ant.apache.org
> >>For additional commands, e-mail:
> >>user-help@ant.apache.org
> >>
> >>
> >>    
> >>
> >
> >
> >		
> >__________________________________ 
> >Do you Yahoo!? 
> >Yahoo! Small Business - Try our new resources site!
> >http://smallbusiness.yahoo.com/resources/ 
> >
>
>---------------------------------------------------------------------
> >To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> >For additional commands, e-mail:
> user-help@ant.apache.org
> >
> >
> >  
> >
> 


		
__________________________________ 
Do you Yahoo!? 
Make Yahoo! your home page 
http://www.yahoo.com/r/hs

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


Mime
View raw message