You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ben Tu <bt...@adobe.com> on 2008/10/07 19:01:36 UTC

find file in specify directory and its sub-directory

Hi,
I would like to accomplish the similar task below in ant script.
Does anyone know how?

find . -name '*.class' | sed -e 's/^.\///g' -e 's/\$/\\\$/g' | sort > log.txt

thanks

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


RE: find file in specify directory and its sub-directory

Posted by Ben Tu <bt...@adobe.com>.
It worked. thanks

-----Original Message-----
From: Matt Benson [mailto:gudnabrsam@yahoo.com]
Sent: Tuesday, October 07, 2008 11:03 AM
To: Ant Users List
Subject: RE: find file in specify directory and its sub-directory

pathsep="${line.separator}"

--- Ben Tu <bt...@adobe.com> wrote:

> Matt,
> This will returned the list of files separate with
> path separator.
> I want it returns a list of files as follow.
>
> ${basedir}/com/abc/a.class
> ${basedir}/com/abc/b.class
>
> Thanks, Ben
>
>
> -----Original Message-----
> From: Matt Benson [mailto:gudnabrsam@yahoo.com]
> Sent: Tuesday, October 07, 2008 10:35 AM
> To: Ant Users List
> Subject: Re: find file in specify directory and its
> sub-directory
>
> Are your sed commands trying to strip off the
> leading
> ./ , then escape dollar signs found?  If so, the
> second probably wouldn't be relevant:
>
> <pathconvert>
>   <fileset dir="${basedir}" includes="**/*.class" />
>   <globmapper from="${basedir}/*" to="*" />
> </pathconvert>
>
> Something like that?
>
> HTH,
> Matt
>
> --- Ben Tu <bt...@adobe.com> wrote:
>
> > Hi,
> > I would like to accomplish the similar task below
> in
> > ant script.
> > Does anyone know how?
> >
> > find . -name '*.class' | sed -e 's/^.\///g' -e
> > 's/\$/\\\$/g' | sort > log.txt
> >
> > thanks
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> > user-help@ant.apache.org
> >
> >
>
>
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
>
>





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


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


RE: find file in specify directory and its sub-directory

Posted by Matt Benson <gu...@yahoo.com>.
pathsep="${line.separator}"

--- Ben Tu <bt...@adobe.com> wrote:

> Matt,
> This will returned the list of files separate with
> path separator.
> I want it returns a list of files as follow.
> 
> ${basedir}/com/abc/a.class
> ${basedir}/com/abc/b.class
> 
> Thanks, Ben
> 
> 
> -----Original Message-----
> From: Matt Benson [mailto:gudnabrsam@yahoo.com]
> Sent: Tuesday, October 07, 2008 10:35 AM
> To: Ant Users List
> Subject: Re: find file in specify directory and its
> sub-directory
> 
> Are your sed commands trying to strip off the
> leading
> ./ , then escape dollar signs found?  If so, the
> second probably wouldn't be relevant:
> 
> <pathconvert>
>   <fileset dir="${basedir}" includes="**/*.class" />
>   <globmapper from="${basedir}/*" to="*" />
> </pathconvert>
> 
> Something like that?
> 
> HTH,
> Matt
> 
> --- Ben Tu <bt...@adobe.com> wrote:
> 
> > Hi,
> > I would like to accomplish the similar task below
> in
> > ant script.
> > Does anyone know how?
> >
> > find . -name '*.class' | sed -e 's/^.\///g' -e
> > 's/\$/\\\$/g' | sort > log.txt
> >
> > thanks
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> > user-help@ant.apache.org
> >
> >
> 
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



      

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


RE: find file in specify directory and its sub-directory

Posted by Ben Tu <bt...@adobe.com>.
Matt,
This will returned the list of files separate with path separator.
I want it returns a list of files as follow.

${basedir}/com/abc/a.class
${basedir}/com/abc/b.class

Thanks, Ben


-----Original Message-----
From: Matt Benson [mailto:gudnabrsam@yahoo.com]
Sent: Tuesday, October 07, 2008 10:35 AM
To: Ant Users List
Subject: Re: find file in specify directory and its sub-directory

Are your sed commands trying to strip off the leading
./ , then escape dollar signs found?  If so, the
second probably wouldn't be relevant:

<pathconvert>
  <fileset dir="${basedir}" includes="**/*.class" />
  <globmapper from="${basedir}/*" to="*" />
</pathconvert>

Something like that?

HTH,
Matt

--- Ben Tu <bt...@adobe.com> wrote:

> Hi,
> I would like to accomplish the similar task below in
> ant script.
> Does anyone know how?
>
> find . -name '*.class' | sed -e 's/^.\///g' -e
> 's/\$/\\\$/g' | sort > log.txt
>
> thanks
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
>
>





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


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


RE: find file in specify directory and its sub-directory

Posted by Ben Tu <bt...@adobe.com>.
Scot,
Thank you for your response. This returns the number of files not the list of actual files.
Ben

-----Original Message-----
From: Scot P. Floess [mailto:floess@mindspring.com]
Sent: Tuesday, October 07, 2008 10:28 AM
To: Ant Users List
Subject: Re: find file in specify directory and its sub-directory


You might check the resourcecount target

On Tue, 7 Oct 2008, Ben Tu wrote:

> Hi,
> I would like to accomplish the similar task below in ant script.
> Does anyone know how?
>
> find . -name '*.class' | sed -e 's/^.\///g' -e 's/\$/\\\$/g' | sort > log.txt
>
> thanks
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros

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


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


Using filters to write property values

Posted by Alec Fernandez <Al...@sas.com>.
Hello,

I am trying to use a copy/filter to replace tokens in a file.

The file is a properties file and the tokens should be replaced with property values.

myproperty=@myvalue@

Obviously this involves writing the property values in escaped unicode encoding so I end up with

myproperty=c\:\\my_dir_name_with_nls_char_\u1234

I've done an ugly workaround that involves using propertyfile to write out the values in the correct format and then using loadfile with a filterchain to read these values back into properties as Strings but I'm thinking there has to be an easier way.

Thanks for any ideas.

-Alec


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


Re: find file in specify directory and its sub-directory

Posted by "Scot P. Floess" <fl...@mindspring.com>.
You might check the resourcecount target

On Tue, 7 Oct 2008, Ben Tu wrote:

> Hi,
> I would like to accomplish the similar task below in ant script.
> Does anyone know how?
>
> find . -name '*.class' | sed -e 's/^.\///g' -e 's/\$/\\\$/g' | sort > log.txt
>
> thanks
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros

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


Re: find file in specify directory and its sub-directory

Posted by Matt Benson <gu...@yahoo.com>.
Are your sed commands trying to strip off the leading
./ , then escape dollar signs found?  If so, the
second probably wouldn't be relevant:

<pathconvert>
  <fileset dir="${basedir}" includes="**/*.class" />
  <globmapper from="${basedir}/*" to="*" />
</pathconvert>

Something like that?

HTH,
Matt

--- Ben Tu <bt...@adobe.com> wrote:

> Hi,
> I would like to accomplish the similar task below in
> ant script.
> Does anyone know how?
> 
> find . -name '*.class' | sed -e 's/^.\///g' -e
> 's/\$/\\\$/g' | sort > log.txt
> 
> thanks
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



      

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