Here is the idea: .Dim file_list, string .Dim next_file, string .Dim old_name, string .Dim new_name, string .Dim ext, string .Dim is_empty, boolean . .Dir "your path here", file_list .isEqual "", file_list, is_empty . .LoopUntil is_empty, END_OF_LOOP . GetToken file_list, ",", next_file . // calc full file name . ConcatEx "old path...", "\\", next_file, old_name . // split file name onto different parts . GetToken next_file, ".", name_part . // build new full file name . Set ext, next_file . ConcatEx "new path...", "\\@T"ddmmyyyy"DY.", ext, new_name . // rename it . FileRename old_name, new_name . . isEqual "", file_list, is_empty .END_OF_LOOP: : Hello, : I can have any number of files in a directory but they will have a unique : file extension - I want to rename the files to todays date and keep the : original file extension and then move them to a backup folder. : eg file.DY1, file.DY2, file.DY3 : Would all be renamed as DDMMYYYY.DY1, DDMMYYYY.DY2, DDMMYYYY.DY3 and then : placed in my backup folder. : The problem I am having is renaming the files to be todays date and keeping : the file extension. I can rename the files using the macro parameter OK to : get todays date but I can't seem to be able to use a wildcard to keep the : file extension. : Any ideas ?
|