Changing date order in file names ?

Hi,

I'm sorry to ask this question because the answer as surely already be given, but I didn't find it. :unsure:

I'd like to change date format in filenames.

I use mp3tags ton rename podcasts files. I've made an "actions" macro to adapt titles and filenames for the small screen of my mp3 reader (Sanza Clip).

I geat files named as :

name_of_the_program 29.01.2010 (01/31/2010 in US format)
(the filename including the date is the title of the program)

But of course, in my mp3 reader, programs are not good sorted. So I'd like to have :

name_of_the_program 2010.01.31

Thanks a lot.

perform an action of the type "replace with regular expression"
search for
(*. )(\d+).(\d+).(\d+)

where (*. ) stands for "name_of_the_program"+blank and becomes section %1
the first (\d+) stands for the 29 and becomes section %2,
the second (\d+) stands for the 01 and becomes section %3
the third (\d+) stands for the 2010 and becomes section %4

and replace it with
%1%4.%3.%2

try it, I hope it works.

Hi,

thanks a lot for your help. I think there're two little problems :

First, when I paste your expressions in the fields of the "replace with regular expression" (on TITLE field), I can't valid. I get an error message
"Regular expression
Invalid preceding regular expression"

the second point is, if I've good understud, that (.) is supposed to detect the name of the program () and the blank before the date (. )
But the name of the program isn't allaways one word.
Some samples :

  • RDV X 23.01.2010
  • Papous 23.01.2010
  • S Guillon 23.01.2010
  • Place Toile 23.10.2010
    So I suppose there will be a problem if * is to recognise only one word. Am I wrong ?
    Should I turn the name of the program in one word by replacing blanks by underscore for instance ?

Thanks for help.

I did it again- mixing up % and $: it must be
$1$4.$3.$2

Actually it is the dot that stands for any character and the asterisk says "I don't care how many".
have you tried the expression with the longer strings? It should work as well as the delimiter is the first number, not the first blank.

Hi,

I've tried again. And I get an error :

Regular expression "(*. )(\d+).(\d+).(\d+)"
Invalid preceding regular expression.

I'm stopped there. And I don't understand : I've read help file again and can't see where your expression could not be perfect !

Try (.* )(\d+).(\d+).(\d+)