Change file date/time to the one included in file name?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
AnthonyCian
Senior Member
Senior Member
Posts: 265
Joined: 2005-06-16, 01:45 UTC
Location: Thatcher Az. USA

Change file date/time to the one included in file name?

Post by *AnthonyCian »

The filename actually has both a date and time stamp. The format how the filename looks is 2014-01-24_AM-12-05-58_FILENAME.RTF
The date/time stamp in the filename is the important one, it doesn't match the system attribute date/time when viewing in tcomm default full view. Is there a way to change the system attribute date/time to the one in the filename??? Other than typing it in manually, there 100s of files like this so an auto process is needed.
This is the opposite of taking the system attributes and putting it in the filename which can be done with plugins. But my situation is the other way around, taking the date/time from the filename to the system attribute date/time.
AnthonyCian
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1052
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

There's the File -> Change Attributes function with plugin tc->writedate. But it only accepts a date datatype so you can't use any string result from Regex or similar plugins.

As I was considering a short AutoIt script I came upon the general 12:00 AM/PM problem. What's the standard algorithm for converting that to ISO/24h/military time?

*Edit: First statement is wrong, second still stands..
Last edited by ZoSTeR on 2014-02-07, 22:29 UTC, edited 2 times in total.
User avatar
silencer
Senior Member
Senior Member
Posts: 208
Joined: 2003-05-13, 13:18 UTC
Location: The Netherlands

Post by *silencer »

Yes there is a way, using "File" -> "change attributes" and use the bottom area for changing with plugin attributes.

First, I have only tested with the following format: 23-01-2014_18-05-58.txt, but you can play a little with te masks in the multirename tool to see what happens.

Use Plugin: TC
Use Property: Writedate (or any other date)
Value: [=tc.fullname:1-10] [=tc.fullname:12-13].[=tc.fullname:15-16].[=tc.fullname:18-19]

Press ok
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50895
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

You need to provide the date/time in the same format as it is displayed when you click on "Load from file under cursor".
Author of Total Commander
https://www.ghisler.com
User avatar
AnthonyCian
Senior Member
Senior Member
Posts: 265
Joined: 2005-06-16, 01:45 UTC
Location: Thatcher Az. USA

Post by *AnthonyCian »

Thanks everyone taking there time in trying to figure this one... I guess then it's not possible to change the date/time atrributes based on the date/time stamp in filename I gave as an example in my first post?

The company policy did away with Outlook PST files, so I have no way in keeping a record of my emails in a PST file. I came across a visual basic Outlook script that will scan the emails and write them as RTF files. It will then use the sent/receive date as the date/time stamp in the format I gave as an example, and subject line is the rest of the filename. But the attributes date/time is the date and time the file was written.

This is just letting the folks who maybe interested how this came about.

AC
User avatar
silencer
Senior Member
Senior Member
Posts: 208
Joined: 2003-05-13, 13:18 UTC
Location: The Netherlands

Post by *silencer »

You can do it, but you need to first do some rename actions to get rid of the AM/PM part. (do not know a 1 click solution)

1. Use MRT with
Search for: PM-01
Replace by: PM-13

2. Use MRT with
Search for: PM-02
Replace by: PM-14

3. Repeat for others...

4. Then use a string like my previous post.
[=tc.fullname:9-10]-[=tc.fullname:6-8][=tc.fullname:1-4] [=tc.fullname:15-16].[=tc.fullname:18-19].[=tc.fullname:21-22]
User avatar
AnthonyCian
Senior Member
Senior Member
Posts: 265
Joined: 2005-06-16, 01:45 UTC
Location: Thatcher Az. USA

Post by *AnthonyCian »

Thanks silencer,
I understand using MRT for steps 1-3. I am somewhat confused on step 4, is that still using MRT or the attributes? I will play around with it and see what I come up with...
AC
User avatar
solid
Power Member
Power Member
Posts: 755
Joined: 2004-08-09, 11:20 UTC

Post by *solid »

2AnthonyCian
It is still MRT, just using plugin fields for placeholders, instead of single letter placeholders.
User avatar
silencer
Senior Member
Senior Member
Posts: 208
Joined: 2003-05-13, 13:18 UTC
Location: The Netherlands

Post by *silencer »

2AnthonyCian
Step 4, is 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]
User avatar
AnthonyCian
Senior Member
Senior Member
Posts: 265
Joined: 2005-06-16, 01:45 UTC
Location: Thatcher Az. USA

Post by *AnthonyCian »

To Silencer:

I got it, but had to play around with it. There are few things to check out to make this work. Below is the example I used to make it work. Not sure how important the "/" ":" is but that's what i used and it worked.

[=tc.fullname:6-7]/[=tc.fullname:9-10]/[=tc.fullname:1-4] [=tc.fullname:15-16]:[=tc.fullname:18-19]:[=tc.fullname:21-22]

Also, very imporatant, make sure under change date/time fields are cleared. If there is a date and time entered that takes over whatever is in the plugin. Once I cleared that, then it worked.

Thanks,

AC
Post Reply