ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter West <...@pbw.id.au>
Subject Re: avoid duplicates with pathconvert and mappers
Date Mon, 15 Apr 2013 12:43:21 GMT
Sorry Patrick, I misread you completely.

Why not create a temp directory, and touch a file with each selected name in that directory?
That would eliminate duplicates. You could then apply the fileset and filters to the temp
directory.

Peter West

"Have you believed because you have seen me? Blessed are those who have not seen and yet believe."

On 15/04/2013, at 7:22 PM, Patrick Martin <antuser@gmail.com> wrote:

> 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


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


Mime
View raw message