Dating files by change attributes / Set date timestamp from part of filename
Moderators: Hacker, petermad, Stefan2, white
Dating files by change attributes / Set date timestamp from part of filename
To change date by some filename substrings, I use for example :
[=tc.Name:7-8].[=tc.Name:5-6].[=tc.Name:1-4] [=tc.Name:9-10].[=tc.Name:11-12].[=tc.Name:13-14]
It's OK.
But now I want to apply the first day of month to each file, because files are monthly and not day-dated.
I tried
01.[=tc.Name:5-6].[=tc.Name:1-4]
but it is not working.
Each time I use some constant instead or expression as [tc.Name:x-y], result is erratic.
See viewtopic.php?f=3&t=52215&start=15#p366971
Unfortunately, same in 9.5 beta 10.
[=tc.Name:7-8].[=tc.Name:5-6].[=tc.Name:1-4] [=tc.Name:9-10].[=tc.Name:11-12].[=tc.Name:13-14]
It's OK.
But now I want to apply the first day of month to each file, because files are monthly and not day-dated.
I tried
01.[=tc.Name:5-6].[=tc.Name:1-4]
but it is not working.
Each time I use some constant instead or expression as [tc.Name:x-y], result is erratic.
See viewtopic.php?f=3&t=52215&start=15#p366971
Unfortunately, same in 9.5 beta 10.
- sqa_wizard
- Power Member
- Posts: 3893
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
Re: Dating files by change attributes
Try it with doublequotes directly after "=" of first plugin entry:
[="01."tc.Name:5-6].[=tc.Name:1-4]
This works at least for me
[="01."tc.Name:5-6].[=tc.Name:1-4]
This works at least for me

#5767 Personal license
Re: Dating files by change attributes
Thanks, but no, result for
And results are the same with or without time indication.
But
It is as if only day as constant gives wrong results, but nor for month neither year as constants.
where dd is a constant between 01 and 31 is dd/05/2006 00:00dd.[=tc.Name:5-6].[=tc.Name:1-4] 00.00.00
And results are the same with or without time indication.
But
where mm is a constant between 01 and 12 and yyyy is a correct year number gives correct result.[=tc.Name:5-6].mm.[=tc.Name:1-4] or [=tc.Nom:3-4].[=tc.Nom:7-8].yyyy
It is as if only day as constant gives wrong results, but nor for month neither year as constants.
Re: Dating files by change attributes
Bingo, sga_wizard. It is working here also.sqa_wizard wrote: 2020-01-01, 16:25 UTC Try it with doublequotes directly after "=" of first plugin entry:
[="01."tc.Name:5-6].[=tc.Name:1-4]
This works at least for me![]()
A big thank.
And sorry : in my previous post I answered to your first answer (deleted by you). Nevertheless I keep that post to show accurately to Christian where is the mistake. So, now Christian has to right that little bug when he has time to do.

Re: Dating files by change attributes
jjk,
Does perhaps "1" work instead of "01"?
Roman
Does perhaps "1" work instead of "01"?
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Re: Dating files by change attributes
No, doesn't work. Always same result : 01/05/2006
And if I use the constant dd as day number (first date field), result is dd/05/2006
Re: Dating files by change attributes
I noticed that if I try to set both date and time like:
its does not work, but if I remove the space before the time value ( [=tc.Name:9-10] ) it works:
EDIT:
It is not correct that it works without the space - It just doesn't give an error message - it does set the date to 01, but the month and year is not set correctly.
Code: Select all
01.[=tc.Name:5-6].[=tc.Name:1-4] [=tc.Name:9-10].[=tc.Name:11-12].[=tc.Name:13-14]
Code: Select all
01.[=tc.Name:5-6].[=tc.Name:1-4][=tc.Name:9-10].[=tc.Name:11-12].[=tc.Name:13-14]

It is not correct that it works without the space - It just doesn't give an error message - it does set the date to 01, but the month and year is not set correctly.
Last edited by petermad on 2020-01-03, 14:06 UTC, edited 2 times in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Dating files by change attributes
Unfortunately, not here (TC 9.10-64 -Win 10-64 v1809). Always same result : 01/05/2006, and time is not set (or not changed), on NTFS and Fat32 drives.petermad wrote: 2020-01-02, 22:27 UTC if I remove the space before the time value ( [=tc.Name:9-10] ) it works:Code: Select all
01.[=tc.Name:5-6].[=tc.Name:1-4][=tc.Name:9-10].[=tc.Name:11-12].[=tc.Name:13-14]
- ghisler(Author)
- Site Admin
- Posts: 50532
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Dating files by change attributes
The attributes dialog only looks for placeholders when the first character is a "[". This is done because some fields like comments accept any kind of characters, so [ would be prefectly OK in a comment.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Dating files by change attributes
Thanks Christian
but I don't understand what you mean.
If I enter "01/02/2009" as value attribute of tc module, it is OK.
So any value can be a constant, not necessarly a placeholder.
Anyway, will it be possible to use 01.[=tc.Name:5-6].[=tc.Name:1-4] or still mandatory to use [="01."tc.Name:5-6].[=tc.Name:1-4] ?
but I don't understand what you mean.
If I enter "01/02/2009" as value attribute of tc module, it is OK.
So any value can be a constant, not necessarly a placeholder.
Anyway, will it be possible to use 01.[=tc.Name:5-6].[=tc.Name:1-4] or still mandatory to use [="01."tc.Name:5-6].[=tc.Name:1-4] ?
menu "Files - Change attributes" > Set tc.writedate to value from file name
I understood it like this :
ghisler(Author) wrote: 2020-01-03, 11:22 UTC The attributes dialog only looks for placeholders when the first character is a "[".
This is done because some fields like comments accept any kind of characters, so [ would be prefectly OK in a comment.
So, an used "[=tc.Name:5-6].[=tc.Name:1-4]"-part is only evaluated, IF the very first sign in that box is an "[" sign.
So this works:
Example Name: "Xenius - La fascination de l’ivoire_Arte_2019_03_29_17_08.ext"
01/02/2009 (no evaluation/expanding need at all) >>> Set writedate to 02.01.2019 (depending on region, here US?)
03.02.2020 (German format) >>> Set writedate to 03.02.2019
[=tc.Name:7-8].[=tc.Name:5-6].[=tc.Name:1-4] (very first sign is an "[") >>> Set writedate to 29.03.2019
[="01."tc.Name:5-6].[=tc.Name:1-4] >>> Set writedate to 01.03.2019 (trick by sqa_wizard, an literal "01." before placeholder)
[=tc.Name:999]01.[=tc.name:-11,2].[=tc.name:-16,4] >>> Set writedate to 01.03.2019 (trick by ghisler(Author) in post below, as "tc.Name:999" will be empty)
This fails to expand the "tc.Names"-parts, because there is no leading "["to switch into that evaluation mode:
01.[=tc.Name:5-6].[=tc.Name:1-4] (very first sign is NOT an "[")
Right?
Example for other readers:
Example Name: "Xenius - La fascination de l’ivoire_Arte_2019_03_29_17_08.ext" >>> Set writedate to 29.03.2019
Utilize "Files - Change attributes" > "More attributes"
Select "tc - writedate" and enter [=tc.name:-8,2].[=tc.name:-11,2].[=tc.name:-16,4]
Taken from: viewtopic.php?f=3&t=52215&start=15#p366971
Re: Dating files by change attributes
^
Roman
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Re: Dating files by change attributes
OK. I understand now.
- ghisler(Author)
- Site Admin
- Posts: 50532
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Dating files by change attributes
Yes, exactly. Something like this should work:
[=tc.Name:256]01.[=tc.Name:5-6].[=tc.Name:1-4] [=tc.Name:9-10].[=tc.Name:11-12].[=tc.Name:13-14]
because [=tc.Name:256] would be empty.
[=tc.Name:256]01.[=tc.Name:5-6].[=tc.Name:1-4] [=tc.Name:9-10].[=tc.Name:11-12].[=tc.Name:13-14]
because [=tc.Name:256] would be empty.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Dating files by change attributes
ghisler(Author) wrote: 2020-01-06, 09:19 UTC Yes, exactly. Something like this should work:
[=tc.Name:256]01.[=tc.Name:5-6].[=tc.Name:1-4] [=tc.Name:9-10].[=tc.Name:11-12].[=tc.Name:13-14]
because [=tc.Name:256] would be empty.
Thanks, that works.
Example Name: "Xenius - La fascination de l’ivoire_Arte_2019_03_29_17_08.ext"
[=tc.Name:999]01.[=tc.name:-11,2].[=tc.name:-16,4] >>> Set writedate to 01.03.2019