#1 2012-01-04 03:23

Glenn
Member
Registered: 2012-01-04
Posts: 7

Invalid file names after using date + time as new name

Hello,

I'm having a bit of a problem renaming pics to "DATE TAKEN"
I would like to format date@time: yyyy-mm-dddd dd,hh:nn:ss AM/PM
I reset (Settings) tab: Meta Tags-Date Format to: yyyy-mm-dddd dd,hh:nn:ss AM/PM
As I test changing some of the rules, I can get the format to enter but the old filename is still there and it say it's invalid.
I am looking to endup with yyyy-mm-dddd dd,hh:nn:ss AM/PM format and delet the old filename.

Your help would be great,
Glenn

Last edited by Stefan (2012-01-04 20:39)

Offline

#2 2012-01-04 03:36

narayan
Senior Member
Registered: 2009-02-08
Posts: 471

Re: Invalid file names after using date + time as new name

Hi Glenn!

Welcome aboard!

I am not sure whether I have understood your problem, but it looks like you are using some invalid characters.

Windows does not allow you to use certain characters in the file's name. Such as : / \ ? < > | *
So your new pattern must be free of those characters.

Please let us know how it turned out.
If you are using a built-in option from ReNamer, please describe your renaming method step-by-step, so that we can help you better.

Last edited by narayan (2012-01-04 03:40)

Offline

#3 2012-01-04 05:27

Glenn
Member
Registered: 2012-01-04
Posts: 7

Re: Invalid file names after using date + time as new name

Example:
I am trying to change an image with a filename: DSC01654.JPG
to: 2010-06-25 Friday,06:14:54 PM.JPG
Using Rule: PascalScript
var
  DateTime: TDateTime;

begin
  DateTime := FileTimeModified(FilePath);
  FileName := WideExtractBaseName(FileName) +
    FormatDateTime('yyyy-mm-dd dddd,hh:nn:ss AM/PM', DateTime) +
    WideExtractFileExt(FileName);
end.

This is the result:
DSC016542010-06-25 Friday,06:14:54 PM.JPG and it is listed as INVALID

I have tried many mix's of Rules and all end up Invalid or wrong.

Also:  I have changed the default date format in Settings to: yyyy-mm-dddd dd,hh:nn:ss AM/PM

Offline

#4 2012-01-04 06:27

narayan
Senior Member
Registered: 2009-02-08
Posts: 471

Re: Invalid file names after using date + time as new name

OK the problem is with "06:14:54" part, as it contains the invalid character :
You will have to replace with a valid character.

Offline

#5 2012-01-04 16:45

Glenn
Member
Registered: 2012-01-04
Posts: 7

Re: Invalid file names after using date + time as new name

Hello again,
That corrected the invalid problem.
Is there a way I can run Rename once to achieve:
1. get rid of old name but leave extension.
2. Run the Script: yyyy-mm-dd_dddd,hh.nn.ss AM/PM as the new Name.

I was able to figure out how to run rules twice to achieve my goal but if I can save time that will be great.

Thank again,
Glenn

Offline

#6 2012-01-04 20:36

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Invalid file names after using date + time as new name

Glenn wrote:

Hello again,
That corrected the invalid problem.
Is there a way I can run Rename once to achieve:
1. get rid of old name but leave extension.
2. Run the Script: yyyy-mm-dd_dddd,hh.nn.ss AM/PM as the new Name.

I was able to figure out how to run rules twice to achieve my goal but if I can save time that will be great.

Thank again,
Glenn


You can add as many rules as you like
and all rules marked by putting a tick in its check box are taken in:
[X] 1) Delete: Delete from Position 1 until the End (skip extension)
[X] 2) PascalScript: begin // Add your code here end.



Maybe read our wiki too: http://www.den4b.com/wiki/ReNamer:Managing_rules


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#7 2012-01-04 20:55

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: Invalid file names after using date + time as new name

Glenn wrote:

Example:
I am trying
FROM:
DSC01654.JPG
TO:
2010-06-25 Friday, 06:14:54 PM.JPG

Maybe this would be easier to do that way:


1.) Change "Settings > Meta Tags > Date format"
     FROM:
     yyyy-mm-dd hh.nn.ss
     TO:
     yyyy-mm-dd dddd, hh.nn.ss AM/PM
     
     http://www.den4b.com/wiki/ReNamer:Meta_Tags
     http://www.den4b.com/wiki/ReNamer:Progr … s_settings


2.) Add two rules:
     [X] 1) Delete: Delete from Position 1 until the End (skip extension)
     [X] 2) Insert: Insert ":EXIF_Date:" as Prefix (skip extension)

3.) Press [Preview]


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#8 2012-01-05 03:22

Glenn
Member
Registered: 2012-01-04
Posts: 7

Re: Invalid file names after using date + time as new name

Thanks very much!!!
It works fantastic.

Glenn

Offline

Board footer

Powered by FluxBB