[Resolved] Moving incrementally named files to three different directories, evenly
Posted: 30 Jun 2019 06:59
Hi,
Been a while since I last posted. Sorry to come asking for help like this but after something unfortunate that occurred (family related) it's found me needing a way to move a directory of sequentially named images (that vary in total number depending on the export to that directory) from a directory into three sub-directories, in three groups (roughly one third each into each sub-directory).
I looked around for a way to achieve this, and came as far as enumerating the number of files in the source directory and dividing it by three but I end up without the complete number of files per group that way for some totals due to the apparent rounding of the 1/3 value.
I also found this post which describes performing a loop of commands based on a fixed number of per file group iterations.
Is there a way to reconcile the concept, so that for example when the directory has 394 total image files the first group moved would be the first 131 files, the second group the next 131 images, then the last 132? Basically accounting for non-whole values in the groupings by appending the remaining file to the last group moved when splitting by a third?
Haven't gotten to the move commands yet but currently encountered this issue when testing the calculation. Perhaps the solution obvious but I'd appreciate any insight with this. Thanks.
Been a while since I last posted. Sorry to come asking for help like this but after something unfortunate that occurred (family related) it's found me needing a way to move a directory of sequentially named images (that vary in total number depending on the export to that directory) from a directory into three sub-directories, in three groups (roughly one third each into each sub-directory).
I looked around for a way to achieve this, and came as far as enumerating the number of files in the source directory and dividing it by three but I end up without the complete number of files per group that way for some totals due to the apparent rounding of the 1/3 value.
I also found this post which describes performing a loop of commands based on a fixed number of per file group iterations.
Is there a way to reconcile the concept, so that for example when the directory has 394 total image files the first group moved would be the first 131 files, the second group the next 131 images, then the last 132? Basically accounting for non-whole values in the groupings by appending the remaining file to the last group moved when splitting by a third?
Haven't gotten to the move commands yet but currently encountered this issue when testing the calculation. Perhaps the solution obvious but I'd appreciate any insight with this. Thanks.