How to set file Date/Time attributes from parts of filename
Moderators: white, Hacker, petermad, Stefan2
- BlackWinny
- Junior Member
- Posts: 45
- Joined: 2014-01-18, 16:10 UTC
- Location: Close to Paris, France
How to set file Date/Time attributes from parts of filename
Hi everybody!
Is there a way (with or without TC) to modify the Date and Time attributes using elements taken from within the filename?
Let's assume I have a filename like this example : "Xenius - La fascination de l’ivoire_Arte_2019_03_29_17_08".
I would like to alter the Date and Time attributes of that file so that the Date of the file will be 2019/03/29 and the Time will be 17:08.
And subsidiary question : if this operation is in batch mode to allow the procedure for several selected files (as done by the batch renamer of TC) it would be the Heaven.
And if actually there isn't anything yet able to do this, I'd be happy to consider it as a suggestion for a future TC feature.
Cheers!
Jacques
Is there a way (with or without TC) to modify the Date and Time attributes using elements taken from within the filename?
Let's assume I have a filename like this example : "Xenius - La fascination de l’ivoire_Arte_2019_03_29_17_08".
I would like to alter the Date and Time attributes of that file so that the Date of the file will be 2019/03/29 and the Time will be 17:08.
And subsidiary question : if this operation is in batch mode to allow the procedure for several selected files (as done by the batch renamer of TC) it would be the Heaven.
And if actually there isn't anything yet able to do this, I'd be happy to consider it as a suggestion for a future TC feature.
Cheers!
Jacques
- sqa_wizard
- Power Member
- Posts: 3864
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
Re: Date/Time attributes from filename
Good news!
All this stuff is already possible, it is just a little tricky.
But once setup and saved, it helps a lot and you can use it at all selected files at once.
It is important to have the date/time always at the end of the filename.
Using the following filename as example:
Xenius - La fascination de l’ivoire_Arte_2019_03_29_17_08
Just mark the file(s) to process and open "Files - Change attributes"
Click on "More attributes"
Select "tc - writedate" and enter [=tc.fullname:-8,2].[=tc.fullname:-11,2].[=tc.fullname:-16,4]
This way you puzzled the date parts counting backwards of the filename and the digits to use
e.g. -16,4 means the year by char number 16 from the end with 4 chars
Click on "More attributes"
Select "tc - writetime" and enter [=tc.fullname:-5,2]:[=tc.fullname:-2,2]
Then press F2 and save your settings first
Finally press OK to apply the date/time to the files.
For the next runs you just have to select the files, open "Files - Change attributes" and load your settings again.
All this stuff is already possible, it is just a little tricky.
But once setup and saved, it helps a lot and you can use it at all selected files at once.
It is important to have the date/time always at the end of the filename.
Using the following filename as example:
Xenius - La fascination de l’ivoire_Arte_2019_03_29_17_08
Just mark the file(s) to process and open "Files - Change attributes"
Click on "More attributes"
Select "tc - writedate" and enter [=tc.fullname:-8,2].[=tc.fullname:-11,2].[=tc.fullname:-16,4]
This way you puzzled the date parts counting backwards of the filename and the digits to use
e.g. -16,4 means the year by char number 16 from the end with 4 chars
Click on "More attributes"
Select "tc - writetime" and enter [=tc.fullname:-5,2]:[=tc.fullname:-2,2]
Then press F2 and save your settings first
Finally press OK to apply the date/time to the files.
For the next runs you just have to select the files, open "Files - Change attributes" and load your settings again.
#5767 Personal license
- ghisler(Author)
- Site Admin
- Posts: 48118
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Date/Time attributes from filename
I recommend using the multi-rename tool (Ctrl+M) constructing the date from the name, because it has a preview. Once you have the right placeholders, copy them with Ctrl+C and put them in the attributes dialog as 2sqa_wizard has described.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- BlackWinny
- Junior Member
- Posts: 45
- Joined: 2014-01-18, 16:10 UTC
- Location: Close to Paris, France
Re: Date/Time attributes from filename
Hello to both of you and also to all the other readers !
First, thanks a lot for your answers, sqa_wizard and Christian !
Thanks to your excellent explanations I have now perfectly understood the way to do.
But it seems that I have a last little issue : I systematically get an error as result, and I think that it is because I don't have the property "fullname". To check its existence I have clicked the little button "+" at the rightmost end of the line... and the property "fullname" is totally absent. For "tc" I only have "creationdate", "writedate", and "accessdate". So I think that I am missing a plugin, am I ?
First, thanks a lot for your answers, sqa_wizard and Christian !
Thanks to your excellent explanations I have now perfectly understood the way to do.
But it seems that I have a last little issue : I systematically get an error as result, and I think that it is because I don't have the property "fullname". To check its existence I have clicked the little button "+" at the rightmost end of the line... and the property "fullname" is totally absent. For "tc" I only have "creationdate", "writedate", and "accessdate". So I think that I am missing a plugin, am I ?
Re: Date/Time attributes from filename
The tc plugin has 31 entries and the fullname is the very first in this list.BlackWinny wrote: ↑2019-03-31, 17:23 UTC Hello to both of you and also to all the other readers !
First, thanks a lot for your answers, sqa_wizard and Christian !
Thanks to your excellent explanations I have now perfectly understood the way to do.
But it seems that I have a last little issue : I systematically get an error as result, and I think that it is because I don't have the property "fullname". To check its existence I have clicked the little button "+" at the rightmost end of the line... and the property "fullname" is totally absent. For "tc" I only have "creationdate", "writedate", and "accessdate". So I think that I am missing a plugin, am I ?
I guess you have set something into the Filter field on the bottom of the screen,
so clear this field to see the full list.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
TC 11.03 x64 / x86
Everything 1.5.0.1375a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.78
QAP 11.6.3.3 x64
TC 11.03 x64 / x86
Everything 1.5.0.1375a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.78
QAP 11.6.3.3 x64
- sqa_wizard
- Power Member
- Posts: 3864
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
Re: Date/Time attributes from filename
TC is a way too smart and offers only attributes directly matching to the first property (Date).... and the property "fullname" is totally absent.
Therefore you have to enter the values manually.
This is the reason why Christian said:
I recommend using the multi-rename tool (Ctrl+M) constructing the date from the name ...
#5767 Personal license
- BlackWinny
- Junior Member
- Posts: 45
- Joined: 2014-01-18, 16:10 UTC
- Location: Close to Paris, France
Re: Date/Time attributes from filename
Hello Horst.Epp
No, no... the Filter field is empty :
Image: http://black.winny.free.fr/Micro/TotalCommander/TotalCommander922a_ChangeAttributes_ChoosePluginProperty.jpg
And in the plugin ShellDetails the property "fullname" (or an equivalent) is absent either (in absence of the property in TC I would have taken its equivalent in this installed plugin).
Some information perhaps useful : my current version of TC is 9.22a (64-bit) and I'm registered since the version 6.51 (in 2005). And the only additional plugins that I use are Shelldetails and 7-zip.
No, no... the Filter field is empty :
Image: http://black.winny.free.fr/Micro/TotalCommander/TotalCommander922a_ChangeAttributes_ChoosePluginProperty.jpg
And in the plugin ShellDetails the property "fullname" (or an equivalent) is absent either (in absence of the property in TC I would have taken its equivalent in this installed plugin).
Some information perhaps useful : my current version of TC is 9.22a (64-bit) and I'm registered since the version 6.51 (in 2005). And the only additional plugins that I use are Shelldetails and 7-zip.
- BlackWinny
- Junior Member
- Posts: 45
- Joined: 2014-01-18, 16:10 UTC
- Location: Close to Paris, France
Re: Date/Time attributes from filename
Hello sqa_wizard
So I would have to use "[N-8-7].[N-11-10].[N-16-13]" directly as is (without the double quotes of course), without changing the "N" occurrences ?
I have also tried "[N:-8,2].[N:-11,2].[N:-16,4]" with the same punition as result.
OOOooommmmm...
sqa_wizard wrote: ↑2019-03-31, 17:57 UTCTC is a way too smart and offers only attributes directly matching to the first property (Date).... and the property "fullname" is totally absent.
Therefore you have to enter the values manually.
This is the reason why Christian said:I recommend using the multi-rename tool (Ctrl+M) constructing the date from the name ...
So I would have to use "[N-8-7].[N-11-10].[N-16-13]" directly as is (without the double quotes of course), without changing the "N" occurrences ?
I have also tried "[N:-8,2].[N:-11,2].[N:-16,4]" with the same punition as result.
OOOooommmmm...
- sqa_wizard
- Power Member
- Posts: 3864
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
Re: Date/Time attributes from filename
The different notations results on the option you set at MRT by choosing "N#-# Range" button.
[N-8-7] is the result of choosing first option
[N:-8,2] is the result of choosing third option
Fortunately all of them work
[N-8-7] is the result of choosing first option
[N:-8,2] is the result of choosing third option
Fortunately all of them work
#5767 Personal license
- BlackWinny
- Junior Member
- Posts: 45
- Joined: 2014-01-18, 16:10 UTC
- Location: Close to Paris, France
Re: Date/Time attributes from filename
But in the Attribute dialog :
It is a point that I'm troubled on.
For the renaming of the filenames (with Ctrl+M), it's been years that I use the variables. So, no problem for them. And I understand that the way to use the offsets in these strings are the same on the Attribute dialog box. No problem for that.
My trouble is with the Attribute changing dialog which doesn't understand the syntax despite the copy/paste.
About Horst.Epp's contribution, it's now ok with the addition from Christian telling that TC is a bit too smart. So yes, if I let the property to change on "comment" I can see all the properties. So Ok, I leave the list not used and I write directly in the field.
So:
- Do I have to use N ? (the letter N)
- Or do I have to use tc.fullname ? (the string tc.fullname)
It is a point that I'm troubled on.
For the renaming of the filenames (with Ctrl+M), it's been years that I use the variables. So, no problem for them. And I understand that the way to use the offsets in these strings are the same on the Attribute dialog box. No problem for that.
My trouble is with the Attribute changing dialog which doesn't understand the syntax despite the copy/paste.
About Horst.Epp's contribution, it's now ok with the addition from Christian telling that TC is a bit too smart. So yes, if I let the property to change on "comment" I can see all the properties. So Ok, I leave the list not used and I write directly in the field.
So:
- I select the file Xenius - La fascination de l’ivoire_Arte_2019_03_29_17_08.mp4.
- I open the Attributes dialog box.
- At the second half of the dialog box, I select "writedate" as property name ("tc" is already selected by default as plugin name).
- Automatically the checkbox "Change plugin attributes" is now ticked.
- I strike "[=tc.fullname:-8,2].[=tc.fullname:-11,2].[=tc.fullname:-16,4]" (without the double quotes) in the text field (in fact as precaution I do a copy/paste, and as you can see there seems to be no error in my syntax).
- And finally I click OK (for the moment, being in my first experimentation before going further).
So of course after I click Yes the attribute isn't changed.Error setting the following attribute:
writedate
Continue ?
Last edited by BlackWinny on 2019-03-31, 21:19 UTC, edited 4 times in total.
- BlackWinny
- Junior Member
- Posts: 45
- Joined: 2014-01-18, 16:10 UTC
- Location: Close to Paris, France
Re: Date/Time attributes from filename
Christian,
On my computer the date separator and the time separator are both set on "-" on the OS instead of the common separators (it is an obligation to make work a special scientific program, so I'm constraint to use this separator for the dates and times).
Could it be the cause of my trouble ?
On my computer the date separator and the time separator are both set on "-" on the OS instead of the common separators (it is an obligation to make work a special scientific program, so I'm constraint to use this separator for the dates and times).
Could it be the cause of my trouble ?
Re: Date/Time attributes from filename
2BlackWinny
What is the format of your systems date? "[=tc.fullname:-8,2].[=tc.fullname:-11,2].[=tc.fullname:-16,4]" is meant for a system using DMY (Day, Month, Year).
If your system is using YMD - then you should use: "[=tc.fullname:-16,4].[=tc.fullname:-11,2].[=tc.fullname:-8,2]"
What is the format of your systems date? "[=tc.fullname:-8,2].[=tc.fullname:-11,2].[=tc.fullname:-16,4]" is meant for a system using DMY (Day, Month, Year).
If your system is using YMD - then you should use: "[=tc.fullname:-16,4].[=tc.fullname:-11,2].[=tc.fullname:-8,2]"
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
- BlackWinny
- Junior Member
- Posts: 45
- Joined: 2014-01-18, 16:10 UTC
- Location: Close to Paris, France
Re: Date/Time attributes from filename
Bingo !!!petermad wrote: ↑2019-04-01, 01:12 UTC 2BlackWinny
What is the format of your systems date? "[=tc.fullname:-8,2].[=tc.fullname:-11,2].[=tc.fullname:-16,4]" is meant for a system using DMY (Day, Month, Year).
If your system is using YMD - then you should use: "[=tc.fullname:-16,4].[=tc.fullname:-11,2].[=tc.fullname:-8,2]"
Image: http://hsjp.eu/smileys/6incr/Incr_Gen_284.gif
You found the real cause of all that ! I didn't despair but I was far from searching in this direction.
Thank you ! Thank you ! Thank you ! Peter you saved my life because I have more than 600 documentaries to change that way !
Image: http://hsjp.eu/smileys/6incr/Incr_Gen_093.gif
And thanks also to sqa_wizard, to Horst.Epp, and to Christian for their helps !
I'm gonna do now the writetime, way easier, then I can go to the next step : saving with F2 and mainly change these attributes for many files at once.
Have a nice week, friends !
- BlackWinny
- Junior Member
- Posts: 45
- Joined: 2014-01-18, 16:10 UTC
- Location: Close to Paris, France
Re: Date/Time attributes from filename
Correction : in fact it is not the property "fullname" which must be taken... but only the property "name". So without the extension (and it makes sense, of course).
All the rest you all wrote is excellent.
All the rest you all wrote is excellent.
Re: Date/Time attributes from filename
Hi all,ghisler(Author) wrote: ↑2019-03-31, 06:50 UTC I recommend using the multi-rename tool (Ctrl+M) constructing the date from the name, because it has a preview.
Let me "mis"-use this thread: From previous discussions I tried the multi-rename-string
[=tc.Name:7-8].[=tc.Name:5-6].[=tc.Name:1-4] [=tc.Name:9-10]:[=tc.Name:11-12]:[=tc.Name:13-14]
to set the file-date according to the name, preview in multi-rename-tool.
Image: https://ibb.co/0nMT1dT
But as soon as I add the first colon to separate hours and minutes ([=tc.Name:9-10]:[=tc.Name:11-12]) I get an error
Image: https://ibb.co/C8BczQY
Where's the fault?
FYI, I'm using 9.50ß10.
Kind regards, thanks and a nice day,
Jensus