Okay, imagine that you have folders A through Z, each with images named 1-20. I want to move all files to a single folder. Doing so would result in 25 sets of the files being overwritten or else the files being renamed 1 (1).jpg, 1 (2).jpg, etc. I do not want either of those outcomes. What I would like to have is an app that automatically bulk renames files in subfolders, so that, for example 1.jpg - 20.jpg in folder A would be renamed A1.jpg through A20.jpg, B would be B1.jpg through B20.jpg, and so on. Also acceptable would be continuously renaming files, such as folder A files still called 1-20, but folder B files would be renamed 21-40 and so on. I have a Windows utility that can do this, but I’m hoping to find one for Android.
There are terminal emulator apps for Android, so once you have that, it’s probably a simple LINUX shell command to do the rename that you’re looking for.
Do you have a terminal emulator installed?
No, but I could install one.
Excellent. I don’t know Linux commands well enough to give you the mv syntax, but it’s probably available somewhere! Are there any Linux users here? I’ll @engineer_comp_geek, just based on his name.
I install Termux and use a standard bash shell.
It resembles a standard shell session on top of the Android Linux kernel; as fas as I can tell, the Google runtime (or Dalvik, as it used to be called) and the Play services don’t interfere much. They’a even a Termux API package that allows access to standard Android API objects.
However, I always root my phones and I have no idea how well it works on an unrooted device, so YMMV.
ETA: Apparently the Google store version of the app is deprecated and outdated, so you would have to side load from F-Droid or Git. Another thing to consider.
I just installed Termux – I had to get it from F-Droid, because it doesn’t seem to be in the Play store anymore.
Do you have a mv command or set of commands that would accomplish what the OP is looking for?
OP, if you connect your Android to your PC, doesn’t it show up as a regular external drive? Maybe the Windows utility would work directly on that.
If your Android device is configured to connect to a computer as a storage device, its shared filesystem will show up in the file explorer as a device folder, and you could use Windows tools (scripting, GUI file managers, etc) to do what you want. I think.
But I believe some Android devices default to only identify themselves to a computer as a device needing charging, not as a storage device, and you would have to switch that on the Android device (by selecting the notification about connecting for charging only and selecting the option about storage or files).
As to how I’d do this file moving/naming task within the bash session, I’d write a script to loop over the source directories and then rhe files within each of the directories (two nested loops), while maintaining an incremented number in a shell variable, prepending the number to the target filename (because prepending is easier than appending the number to just filename part while leaving the extension untouched).
And I’d test the heck out of it by making the script echo all of the generated move commands it would execute rather than executing them before I trusted it enough to remove the echo statement and unmask the actual mv command.
Yes, you have to change the USB setting, but it shows up as a prompt as soon as you connect it (at least on mine).
I think I probably need to just copy all of the folders over to my PC, do the editing there, and move the files back to the phone, since a lot of digging isn’t coming up with an app equivalent to Windows options.
This method is just what I was going to suggest. Much easier, and if you screw it up, you can easily start anew.