need script to copy image files to folders date wise
need script to copy image files to folders date wise
hello sir,
i have a lot of image files like .jpg,.jpeg and .png in one folder. now i want to move all those image files to date wise folders .
images are available in D:\AVI\images\
captured images are
D:\AVI\images\2020-04-21_204539.png
D:\AVI\images\2020-04-21_204511.png
with regards,
i have a lot of image files like .jpg,.jpeg and .png in one folder. now i want to move all those image files to date wise folders .
images are available in D:\AVI\images\
captured images are
D:\AVI\images\2020-04-21_204539.png
D:\AVI\images\2020-04-21_204511.png
with regards,
Re: need script to copy image files to folders date wise
And?
99% the same procedure as in all other scripts you've requested...
Code: Select all
listfolder() / quicksearch() / whatever()
A loop
gpc()
substr() / regexmatch()
moveto ...
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de
Re: need script to copy image files to folders date wise
need same script, tried to do one, but spent few hours and can't understand how to get creation/modified date of item from variable in particular format?
it's wrong, but just to understand what i'm trying to do..
it's wrong, but just to understand what i'm trying to do..
Code: Select all
foreach($item, listfolder(), '|') {
moveto <datem dd.mm.yy>, $item, , 2, , , 1;
}
Win 7 SP1 x64 100% 1366x768
Re: need script to copy image files to folders date wise
For this to work, "Configuration | General | Sort and Rename | Rename | [x] Allow move on rename"
must be ticked...
?
Or whatever format you like regarding the modified date...
Do NOT replace the single quotes around the datem variable with double quotes!
must be ticked...
Code: Select all
rename "b", '<datem yyyy-mm-dd>\*', "p", listfolder(), 64;
Or whatever format you like regarding the modified date...
Do NOT replace the single quotes around the datem variable with double quotes!
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de
Re: need script to copy image files to folders date wise
thank you for example, but feels kinda not what i want to do(plus dependant on that setting).
main problem is that i can't figure out(just as a knowledge for future scripts) - how to get date of item(not selected, but picked from variable) in particular format?
for example this gives me date, but i can't format it= property(#4, $item);
main problem is that i can't figure out(just as a knowledge for future scripts) - how to get date of item(not selected, but picked from variable) in particular format?
for example this gives me date, but i can't format it= property(#4, $item);
Win 7 SP1 x64 100% 1366x768
Re: need script to copy image files to folders date wise
That's the script you've posted as a one-liner (with a different date format) so what exactly is wrong with it?thank you for example, but feels kinda not what i want to do
XY has inbuilt properties, you can just use
property("#date.m", $item)
and
formatdate([date], [format], [shift_unit], [shift_num])
allows you to format that...One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de
Re: need script to copy image files to folders date wise
for example it gives no control over dates preservation.
property("#date.m", $item) gives me "name_of_week time_hh_nn_ss" and formatdate later says "i don't understand such date".
that's why i asked exactly how to get date in selected format from start. say for simply selected item <datem dd-mm-yy> works as desired, i need same for item from a variable.
Win 7 SP1 x64 100% 1366x768
Re: need script to copy image files to folders date wise
Code: Select all
foreach($item, listfolder()) {
moveto formatdate(property("#3", $item), "dd.mm.yy"), $item, , 2, , , 1;
}
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de
Re: need script to copy image files to folders date wise
still says invalid date, may it happen you know what's wrong?(seems like not in script)
Win 7 SP1 x64 100% 1366x768
Re: need script to copy image files to folders date wise
You could check your OS date format
Control panel - Clock and Region - Change date, time, or number formats
+ "Additional settings"
but I'm not aware of any format like that as a configurable setting "name_of_week time_hh_nn_ss"
What does
Does a fresh XY instance display the same?
Control panel - Clock and Region - Change date, time, or number formats
+ "Additional settings"
but I'm not aware of any format like that as a configurable setting "name_of_week time_hh_nn_ss"
What does
text property("#3", <curitem>);
exactly display for a selected item?Does a fresh XY instance display the same?
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de
Re: need script to copy image files to folders date wise
it displays in format "Tuesday 12:54", "Monday 18:11", even in fresh.
so i see it's sometime about system date problem, will search for solution, thank you for all answers and script help.
;------------------
found it, "short date" was in strange format, though never touched it. still kinda strange, will add some safety in case local date settings on other OS maybe same "different".
Win 7 SP1 x64 100% 1366x768
Re: need script to copy image files to folders date wise
with the help of @highend in this topic, made a second version of script that operates not file-by-file, but first collects items with same date, to make less operations and everything overall faster.
Code: Select all
$listOfItems = report("{Fullname}|{Modified dd-mm-yy}<crlf>"); //get list of items in format: Fullpath|dd-mm-yy (modified date)
msg "Date example:<crlf>".gettoken(gettoken($listOfItems, 1, "<crlf>"), 2, "|"), 32 + 1; //chech date format
while(true){
if (!$listOfItems) { break; } //break if list is empty
$itemDate = gettoken(gettoken($listOfItems, 1, "<crlf>"), 2, "|"); //get date of first item(separate second part of report date entry)
//echo $itemDate;
$sameDate = formatlist($listOfItems, "f", "<crlf>","*$itemDate"); //get all items with same date
$sameDate =replacelist($sameDate, "|$itemDate", , "<crlf>"); //clear report entried leaving only Fullpath
//echo $sameDate;
moveto $itemDate, $sameDate, , 2, , , 1; //move items to folder named after "modified date"
$listOfItems = formatlist($listOfItems, "f", "<crlf>","!*$itemDate"); //exclude operated itemsfrom overal list
//echo $listOfItems;
}
Win 7 SP1 x64 100% 1366x768
Re: need script to copy image files to folders date wise
Very useful script, thank you highend and eil