Change date/time getting values from filename
Moderators: Hacker, petermad, Stefan2, white
-
- Junior Member
- Posts: 37
- Joined: 2011-04-01, 21:11 UTC
Change date/time getting values from filename
Hello,
i have several files named:
abcd_year_month_day_hh_mm_ss.txt
ghedfdwdwe__year_month_day_hh_mm_ss.txt
xxxxx_year_month_day_hh_mm_ss.txt
urca_year_month_day_hh_mm_ss.txt
I'm looking for a method to change date/time of every file getting values from "year_month_day_hh_mm_ss" part of file name. It's possible with TC?
Thanks.
P.S.: i also need to change my profile's email on this forum...
i have several files named:
abcd_year_month_day_hh_mm_ss.txt
ghedfdwdwe__year_month_day_hh_mm_ss.txt
xxxxx_year_month_day_hh_mm_ss.txt
urca_year_month_day_hh_mm_ss.txt
I'm looking for a method to change date/time of every file getting values from "year_month_day_hh_mm_ss" part of file name. It's possible with TC?
Thanks.
P.S.: i also need to change my profile's email on this forum...
Take a look at that posts:
http://ghisler.ch/board/viewtopic.php?t=33512&highlight=date+filename
http://ghisler.ch/board/viewtopic.php?t=39466&highlight=date+filename
http://ghisler.ch/board/viewtopic.php?t=15794&highlight=date+filename
and some more....
Adopt that syntax to match the parts in your file name pattern "abcd_year_month_day_hh_mm_ss.txt"selecting the files in the normal file window (not MRT)
and goto Menu "File" -> "change attributes"
In the bottom you can select to use plugins to change attributes.
Use Plugin: TC
Use Property: Writedate (or any other date)
Value: [=tc.fullname:9-10]-[=tc.fullname:6-8][=tc.fullname:1-4] [=tc.fullname:15-16].[=tc.fullname:18-19].[=tc.fullname:21-22]
http://ghisler.ch/board/viewtopic.php?t=33512&highlight=date+filename
http://ghisler.ch/board/viewtopic.php?t=39466&highlight=date+filename
http://ghisler.ch/board/viewtopic.php?t=15794&highlight=date+filename
and some more....
-
- Junior Member
- Posts: 37
- Joined: 2011-04-01, 21:11 UTC
Regrets
This does seem to be a difficult way of configuring a file: counting characters and testing success, then doing it again for the second section; testing, repeating; testing, repeating..
It reminds me of pushing out chads in punch cards with a paper clip, counting the columns, pushing, counting... inserting the stack in a reader and tesing the batch. That's many years ago.
We do have a GUI to work with these days, thank The Fates. A GUI, or a VMU - a Visual Method of Use.
Is there no way that we can select ranges of a filename *visually* to compose an expression? The Multi-rename Tool has the facility; nothing for Change Attributes?
Anything other than this chisel and stone method would be better, IMHO
TC showing its VMU age..
[PS Change your email address in your Profile, zupermario. Notifications to my Yahoo address never got to me, so be careful.]
It reminds me of pushing out chads in punch cards with a paper clip, counting the columns, pushing, counting... inserting the stack in a reader and tesing the batch. That's many years ago.
We do have a GUI to work with these days, thank The Fates. A GUI, or a VMU - a Visual Method of Use.
Is there no way that we can select ranges of a filename *visually* to compose an expression? The Multi-rename Tool has the facility; nothing for Change Attributes?
Anything other than this chisel and stone method would be better, IMHO

TC showing its VMU age..
[PS Change your email address in your Profile, zupermario. Notifications to my Yahoo address never got to me, so be careful.]
Use 'Multi-rename Tool' for 'Change Attributes' expression
The trick here is to utilize first the 'Multi-rename Tool'Phred wrote: Is there no way that we can select ranges of a filename *visually* to compose an expression? The Multi-rename Tool has the facility; nothing for Change Attributes?
to compose the expression,
then copy & paste the expression string to the 'Change Attributes' dialog.
Egad
Hmm.
This is part of my hand-crafted 'scratch-pad' in the MrT:
[N25-28]-[N22-23]-[N19-20]+[=tc.fullname:25-28]
A work in progress.
For the file 30-the-uk-report--30-05-2016.mp3
So I walk into the workshop next door, configure the lathe and the cutting tool for the work there; trial it, then detach the tool and return to the workshop I came from and plug it in there.
Then do the work.
Less than ideal in 2016.
(Have you looked at the TC home page lately; there's a reference to October, 2006 there... And TC CE/Pocket
)
This is part of my hand-crafted 'scratch-pad' in the MrT:
[N25-28]-[N22-23]-[N19-20]+[=tc.fullname:25-28]
A work in progress.
For the file 30-the-uk-report--30-05-2016.mp3
So I walk into the workshop next door, configure the lathe and the cutting tool for the work there; trial it, then detach the tool and return to the workshop I came from and plug it in there.
Then do the work.

Less than ideal in 2016.
(Have you looked at the TC home page lately; there's a reference to October, 2006 there... And TC CE/Pocket

Try This
.
WORKING EXAMPLE
To re-date-&-time the file:
13-queen's-birthday-honours--greg sheridan.mp3
..to the date the podcast was published, rather than downloaded, the 13th June '16, in the logical EU/AU/JP small-bigger-biggest date format, at 10:12 p.m., use this:
File | Change attributes; tick Change plugin attributes,
Plugin: tc, Property: writedate, [=tc.name:1-2]/06/2016
+ (more attributes)
Plugin: tc, Property: writetime, 22:22:00
OK
Mutatis mutandis; change format according to taste.
In words, the leading two characters ('[=tc.name:1-2]') of the filename are being taken to change the file's date attribute; the date Windows shows the file as arriving/being last written/saved.
To those first two characters is added the rest of the date: /06/2016 - in the exact, current, date format TC is displaying.
The full Value of the Property writedate becomes: [=tc.name:1-2]/06/2016
At the same time, the last time written/saved can be changed to 10:22 p.m. with the Value 22:22:00
Press OK to complete and thereby change the date/time attributes from the information in the filename.
TC sets the file's date to 13/06/2016 and its time to 22:22.
QED
WORKING EXAMPLE
To re-date-&-time the file:
13-queen's-birthday-honours--greg sheridan.mp3
..to the date the podcast was published, rather than downloaded, the 13th June '16, in the logical EU/AU/JP small-bigger-biggest date format, at 10:12 p.m., use this:
File | Change attributes; tick Change plugin attributes,
Plugin: tc, Property: writedate, [=tc.name:1-2]/06/2016
+ (more attributes)
Plugin: tc, Property: writetime, 22:22:00
OK
Mutatis mutandis; change format according to taste.
In words, the leading two characters ('[=tc.name:1-2]') of the filename are being taken to change the file's date attribute; the date Windows shows the file as arriving/being last written/saved.
To those first two characters is added the rest of the date: /06/2016 - in the exact, current, date format TC is displaying.
The full Value of the Property writedate becomes: [=tc.name:1-2]/06/2016
At the same time, the last time written/saved can be changed to 10:22 p.m. with the Value 22:22:00
Press OK to complete and thereby change the date/time attributes from the information in the filename.
TC sets the file's date to 13/06/2016 and its time to 22:22.
QED