Change attributes: get date/time from file name?

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
krapet
Junior Member
Junior Member
Posts: 21
Joined: 2007-08-02, 06:39 UTC
Location: Czech

Change attributes: get date/time from file name?

Post by *krapet »

Modify: Change date/time using Multi-rename tool rules

I miss possibility to change date/time of files by the filename.
For example filename for "My photo 20120131.jpg" I would like to set date 31.1.2012 so in "Date" filed I will put:

Code: Select all

[N16-17].[N14-15].[N10-13]
For multiple files it can look like this.

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

Post by *ghisler(Author) »

Internal fields are not supported there, but you can use content plugins. The above would look like this:
[=tc.Name:16-17].[=tc.Name:14-15].[=tc.Name:10-13]

This will only work in the plugins part, so use the tc - modification date value.
Author of Total Commander
https://www.ghisler.com
krapet
Junior Member
Junior Member
Posts: 21
Joined: 2007-08-02, 06:39 UTC
Location: Czech

Post by *krapet »

Thanks for answer.

Just note.
No preview is available, nor for the first file.
It is a little uncomfortable.

Instruction for other users:
Change plugin attributes: ticked
(click on More attributes)
Plugin: tc
Property: write date
Value: [=tc.Name:16-17].[=tc.Name:14-15].[=tc.Name:10-13]

It was tested and works (for FAT32 and NTFS) when writedate/writetime is selected.
krapet
Junior Member
Junior Member
Posts: 21
Joined: 2007-08-02, 06:39 UTC
Location: Czech

Modification of drop down menu: Change plugin attributes

Post by *krapet »

File => Change attributes => Change plugin attributes => More attributes

Currently in drop down menu (button [+] ) are available all items for tc.comments property only.
http://imageshack.us/a/img829/6994/tcchangeattrpluginscomm.png

Could you make them (or at least "fullname", "name", "ext", "path") available also for other properties:
> creationdate
> creationtime
> writedate
> writetime
> accessdate
> accesstime
http://imageshack.us/a/img577/1341/tcchangeattrpluginscrea.png
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48118
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

TC only shows compatible fields. But if you enter a field manually, TC tries to convert the string value to the destination field as good as it can. But normally it makes no sense to convert a comment to a creation date.
Author of Total Commander
https://www.ghisler.com
af09940
Junior Member
Junior Member
Posts: 3
Joined: 2012-10-23, 07:14 UTC

Post by *af09940 »

I have Files with diffent namelength and date behind (
firstfilename 2012-02-26 19-21.txt
secondfilename 2012-05-12 20-54.yyy
)

Is there any way to count the namestring from the end to get the date?
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Just try to use negative indexes. E.g. [=tc.Name:-16-13] for year (just check what you get with multi-rename tool).
af09940
Junior Member
Junior Member
Posts: 3
Joined: 2012-10-23, 07:14 UTC

Post by *af09940 »

OK - I tried it all...

I named a Testfile as 11111111111111111990.txt.

I tested the above shown string to see it´s working in any way and it works for normal changing the writedate.

But when I use the "-" before the position number ([=tc.Name:-1-4]) to count from the right side 4 characters backwards I only get the year 2000!!!

No matter what the filename says the last four characters (2010 or 2011 or 1990). Always it is 2000 by using negative counting.

What can I do else?
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3864
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

Just use [=tc.Name:-4-1]
#5767 Personal license
af09940
Junior Member
Junior Member
Posts: 3
Joined: 2012-10-23, 07:14 UTC

Post by *af09940 »

You are right - it should be -4-1... But it still doesn´t work. Did you try it? May be I´m wrong in any way...

I only get the year 2000 - no matter what the filename says...

Any other suggestions?
User avatar
white
Power Member
Power Member
Posts: 4632
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

af09940 wrote:Any other suggestions?
Forgot to check the checkbox "Change plugin attributes"?
Mixing up creation date/write date?

Does the expression show the correct value in the multi rename tool?

Can you post a screen shot of what you are doing?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48118
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Just use -4- for all the characters after the 4th-last.

Or use -4,4 (which means from the 4th-last with a length of 4).
Author of Total Commander
https://www.ghisler.com
Post Reply