ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Martin <antu...@gmail.com>
Subject avoid duplicates with pathconvert and mappers
Date Mon, 15 Apr 2013 09:22:27 GMT
Hello,

I have a folder looking like:
folder1/file-1.txt
folder1/file-2.txt
folder2/file-1.txt
folder2/file-3.txt

i'd like to list the file ids: 1,2,3.

Trying with pathconvert:
        <pathconvert property="id.list" pathsep=",">
            <fileset dir="${mydir}" includes="folder*/*.txt" />
            <chainedmapper>
                <flattenmapper />
                <regexpmapper from="file-([^-]+).txt" to="\1" />
            </chainedmapper>
        </pathconvert>

However, the id 1 gets duplicated. Is there anyway I can avoid this dupe?

The pathconvert attribute preserveduplicates="false" does not bring any
help here.
I also tried the uniq filter in a filtermapper, without luck.

Thank you in advance,

Patrick

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