move rename date pattern

2014-09-20 Thread Erik Itter
Hello, I am trying to automate my environment a little more and thought to do the following: In directory $foo$ take file [\d\d\d\d-\d\d-\d\d zzz_today.ico] and rename it to [-mm-dd zzz_today.ico] filling in the actual current date. Further I'd like to rename another file [\d\d\d\d-\d\d-

Re: move rename date pattern

2014-09-20 Thread Al Le
> In directory $foo$ take file [\d\d\d\d-\d\d-\d\d zzz_today.ico] and > rename it to <... something not trivial ...> If I have to do something which I can't easily do with standard Ant tasks I use the script task, usually with JavaScript. There, you can do whatever computations you want and pas

Re: move rename date pattern

2014-09-20 Thread Erik Itter
Yeah, thx. Guess writing my own task would not have been a lot different but following your advice this does it for me (with a little simplification added by delting and copying rather than renaming [and ignoring different length of months which is more appropriate for my use case anyways]):

Re: move rename date pattern

2014-09-20 Thread Al Le
If it works for you then it's fine. I'd do it a little bit differently. I'd use the script to only calculate the date strings and would perform copying/deletion by the standard ant tasks (copy/...). I strive to use script tasks for as little as possible in ant scripts.