Week Number in File Name
Moderators: XnTriq, helmut, xnview
Week Number in File Name
Is there a way to add "week number" into the file name during a rename operation?
Re: Week Number in File Name
Week number can be different in (Canada, U.S.) and (Europe ?)
Week Number ISO : week 1, is the one which contains January 4th .
(Mon Dec, 29th can be in week 1 ISO. So Mon, dec 29th 2008 is in week 1 , 2009 iso)
Maybe you can ask this question on ExifTool forum
Exiftool can rename files with a part of a date , but I don't know how to insert week number in the filename
You can use ExifTool through XnViewMP with "Tools, Open With , Configure", select AddOn\exiftool.exe , and add the right parameters ...
You can try this parameter -d %W "-FileName<CreateDate"
Maybe it's a part of the solution ?
(see https://exiftool.org/filename.html , next to the end of the page)
EDIT : use these parameters to add week number ($createdate) before filename (%f) with format ( -d %W) and keep exiftool window open(-k)
Week Number ISO : week 1, is the one which contains January 4th .
(Mon Dec, 29th can be in week 1 ISO. So Mon, dec 29th 2008 is in week 1 , 2009 iso)
Maybe you can ask this question on ExifTool forum
Exiftool can rename files with a part of a date , but I don't know how to insert week number in the filename
You can use ExifTool through XnViewMP with "Tools, Open With , Configure", select AddOn\exiftool.exe , and add the right parameters ...
You can try this parameter -d %W "-FileName<CreateDate"
Maybe it's a part of the solution ?
(see https://exiftool.org/filename.html , next to the end of the page)
EDIT : use these parameters to add week number ($createdate) before filename (%f) with format ( -d %W) and keep exiftool window open(-k)
Code: Select all
-k -d %W "-FileName<$CreateDate%f"
Last edited by michel038 on Mon Apr 19, 2021 6:30 pm, edited 2 times in total.
Catalogage avec XnviewMP : https://orchisere.fr/logiciels/html/xnviewmpintro.htm
Tutoriel exiftool : https://orchisere.fr/logiciels/html/exiftool.htm
Tutoriel exiftool : https://orchisere.fr/logiciels/html/exiftool.htm
Re: Week Number in File Name
Thanks for the response, both of you! I was able to get the xnview suggestion setup to rename files using this standard: YYYY-WW-MMDD-HHMMSS.jpg!
I'm sure this is a dumb question, but I will ask anyways because asking dumb questions is just what i do sometimes.
I have been using this for file renaming, "{EXIF:Date [Ymd-HMS]}" for an output of YYYYMMDD-HHMMSS.jpg. Why can't xnview use the %W modifier in file renames, to give an output like YYYY-WW-MMDD-HHMMSS.jpg?
I am reviewing & studying the exiftools renaming flags, but wow there is a lot there. Do you know if there is a way to "insert" week number into a file name? I already have files named "YYYYMMDD-HHMMSS--<notes>.jpg". Can I make this look like "YYYY-WW-MMDD-HHMMSS--<notes>.jpg"?
Thanks.
I'm sure this is a dumb question, but I will ask anyways because asking dumb questions is just what i do sometimes.
I have been using this for file renaming, "{EXIF:Date [Ymd-HMS]}" for an output of YYYYMMDD-HHMMSS.jpg. Why can't xnview use the %W modifier in file renames, to give an output like YYYY-WW-MMDD-HHMMSS.jpg?
I am reviewing & studying the exiftools renaming flags, but wow there is a lot there. Do you know if there is a way to "insert" week number into a file name? I already have files named "YYYYMMDD-HHMMSS--<notes>.jpg". Can I make this look like "YYYY-WW-MMDD-HHMMSS--<notes>.jpg"?
Thanks.
Re: Week Number in File Name
XnViewMp has it's own set of formats.Why can't xnview use the %W modifier in file renames
ExifTool is another world.
I think it's possible to process replacement with ExifTool (replace year by year-week) you can ask this in ExifTool forum...
Catalogage avec XnviewMP : https://orchisere.fr/logiciels/html/xnviewmpintro.htm
Tutoriel exiftool : https://orchisere.fr/logiciels/html/exiftool.htm
Tutoriel exiftool : https://orchisere.fr/logiciels/html/exiftool.htm
Re: Week Number in File Name
Why doesn't xnview have a "week number" variable, though? Is there some technical reason, or something else?
Re: Week Number in File Name
As I said above,I already have files named "YYYYMMDD-HHMMSS--<notes>.jpg". Can I make this look like "YYYY-WW-MMDD-HHMMSS--<notes>.jpg"?
You should choose a name to insert in first column for this "open with" feature, such as AddWeekNumber.You can use ExifTool through XnViewMP with "Tools, Open With , Configure", select AddOn\exiftool.exe , and add the right correct parameters ...
This parameter can do the job, first with TestName so you can read ExifTool report, with previous name and the new calculated name for files.
Code: Select all
-k -d %Y-%W- -TestName<${CreateDate}${FileName;s/^[0-9]{4}//}
Explanation
-k : keep exiftool window open
-d : Date format ...
%Y-%W- : Year (4 digits), caret, Week, caret
-TestName : target field (replace -TestName by -FileName for effective renaming)
< : Result of following expression will enter in TestName
${ : Evaluate expression
CreateDate : source data to be filtered by -d option before entering into TestName
FileName : 2nd source data to append to TestName (${FileName : FileName will also be processed)
; (semicolon) : a process is following
s/^[0-9]{4}/ : replace four digits at the beginning of Filename ... (RegEx processing)
/ : by nothing
Usage
Select files, Right Click, Open With, AddWeekNumber ...
Catalogage avec XnviewMP : https://orchisere.fr/logiciels/html/xnviewmpintro.htm
Tutoriel exiftool : https://orchisere.fr/logiciels/html/exiftool.htm
Tutoriel exiftool : https://orchisere.fr/logiciels/html/exiftool.htm