Let's say I have some directories which contain files. For example, the directories
/home/me/files/files_10 /home/me/files/files_11 /home/me/files/files_12
each of which contains some files corresponding to the last digits. For example, the directory /home/me/files/files_10 contains files
/home/me/files/files_10/file_100.txt /home/me/files/files_10/file_102.txt /home/me/files/files_10/file_105.txt /home/me/files/files_10/file_106.txt etc
The file numbers do grow larger, but do not necessarily include each digit (as 101, 103, 104 are missing in this case).
I am seeking to count the number of files between two inputted values. Given the example above, if my first value was 100 and my second value was 105, I would like the output to be 3. If the first value was 103 and the second value was 106, I would like the output to be 2. Furthermore, let's say I give a first value of 112 and a second value of 125. I would like to go into the corresponding directories (ending with 11 and 12), and count the number of files between these two values.
This is a simplified version of what I'm working with, but is functionally equivalent. What scheme could accomplish this? Thanks!