hi,
there are 2 situations(very useful):
1."A.txt" to "A-M0difiedDate.txt";(i use: rename b , '*-<datem yyyymmdd>')
2.A renamed file was modified later , need "A-Olddate.txt" to "A-NewModifiedate.txt" (i use: rename r , '[0-9]{8} > <datem yyyymmdd>')
there are 2 problems:
1.in situation 2,some old files were named like "XXX130519.txt",not like"XXX-20130519.txt",how to deal with it too?
2.now i set 2 User-Defined Commands to deal with different situations, how can i accomplish with a single command?
thanks.,this will help me a lot!
-----------------------------------------------------------------
Ok guys, I have solved it.
[resolved]Rename filenames with modified date and update
[resolved]Rename filenames with modified date and update
Last edited by cren on 24 May 2013 12:09, edited 1 time in total.
Re: Rename filenames with modified date and update them
studied on regexp,problem 1 solved:
1.in situation 2,some old files were named like "XXX130519.txt",not like"XXX-20130519.txt",how to deal with it too?
2.now i set 2 User-Defined Commands to deal with different situations, how can i accomplish with a single command?
working on it now...
1.in situation 2,some old files were named like "XXX130519.txt",not like"XXX-20130519.txt",how to deal with it too?
Code: Select all
rename r , "[0-9]{6}|[0-9]{8} > <datem yyyymmdd>"working on it now...
Re: Rename filenames with modified date and update them
Done! It works well for me!
Load the script , set a shortcut ,and enjoy!
Code: Select all
IF(regexmatches("<curbase>","\d{4}((1[0-2])|(0\d))(([12]\d)|(3[01])|(0\d))") )
{rename r ,"[-/._]?\d{4}((1[0-2])|(0\d))(([12]\d)|(3[01])|(0\d)) > -<datem yyyymmdd>";}
//match on yyyymmdd
elseif(regexmatches("<curbase>","\d{2}((1[0-2])|(0\d))(([12]\d)|(3[01])|(0\d))") )
{rename r ,"[-/._]?\d{2}((1[0-2])|(0\d))(([12]\d)|(3[01])|(0\d)) > -<datem yyyymmdd>";}
//match on yymmdd
elseif(regexmatches("<curbase>","((1[0-2])|(0\d))(([12]\d)|(3[01])|(0\d))") )
{rename r ,"[-/._]?((1[0-2])|(0\d))(([12]\d)|(3[01])|(0\d)) > -<datem yyyymmdd>";}
//match on mmdd
else
{rename b ,'*-<datem yyyymmdd>';}
//just add date
XYplorer Beta Club