You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Chris Chang <ch...@cendec.com> on 2003/03/13 00:45:17 UTC

Append a line with filename for each selected files

Folks,

I would like append a line (with the corresponding filename) for each file
in a directory (including sub-directory), any ideas?

<!--
example
-->
DirA -> DirB -> abc.txt (append "abc.txt" to this file)
                bcd.txt (append "bcd.txt" to this file)
        qwr.txt (append "qwr.txt" to this file)
        nmm.txt (append "nmm.txt" to this file)



Thanks in advance!

Chris

Re: Append a line with filename for each selected files

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 12 Mar 2003, Chris Chang <ch...@cendec.com> wrote:

> I would like append a line (with the corresponding filename) for
> each file in a directory (including sub-directory), any ideas?

Use a <fileset> within a <path> to collect the files, run
<pathconvert> over the path using &#x0A; as separator (you may want a
CR as well if you are on Windows) and <echo> the result to a file.

Stefan