You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Dick, Brian E." <Br...@FMR.com> on 2005/01/19 16:36:16 UTC

Remove extension from a file name

I need to remove the extension from a file name. The basename task
almost works when specifying the suffix attribute. However, I don't know
the value of the suffix.

Does anyone know how I can remove the extension (suffix) from a file
name?

Later,
BEDick

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


Re: Remove extension from a file name

Posted by Gerard Janssen <ge...@janssenenjansen.nl>.
The attached class contains a custom task that will do the trick. The javadoc 
explains how to use it.



Gerard



On Wednesday 19 January 2005 16:36, Dick, Brian E. wrote:
> I need to remove the extension from a file name. The basename task
> almost works when specifying the suffix attribute. However, I don't know
> the value of the suffix.
>
> Does anyone know how I can remove the extension (suffix) from a file
> name?
>
> Later,
> BEDick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org