+CharlieChaplin Posted May 23, 2022 Share Posted May 23, 2022 Stupid me, I downloaded the latest SAP archive (from 2015, quite old!) and put every file into an alphabetized (A-Z) subfolder. So there is no longer a Game, Composer or other folder, just the files in subfolders A-Z. Now I have more than 5000 files and most of them use 40 chars or more - how do I rename them automatically to 8.3 filenames, so I can use and playback them on the A8? Normally I use Ant Renamer for my renaming jobs, it has various renaming functions, but rename from x chars to 8.3 filename is not one of them, it seems. If I need a batchfile, please specify what to type in the batchfile -or- if there is a windows program (Win XP or Win 10) please let me know where to find it. Think it is understandable that I do not want to rename more than 5000 files manually into 8.3 filenames. When simply copying these files to MS-DOS, it "renames" them to 8.3 it seems, alas any duplicates are renamed into filena~1 to max. filena~4, then only numbers (8 numbers) are used instead of filenames, so I would need some AI that uses e.g. filena01 up to filena99 or 6 letters + 2 numbers... Quote Link to comment Share on other sites More sharing options...
invisible kid Posted May 23, 2022 Share Posted May 23, 2022 (edited) deleted Edited May 23, 2022 by invisible kid Quote Link to comment Share on other sites More sharing options...
Mclaneinc Posted May 23, 2022 Share Posted May 23, 2022 Regular expressions seems the way to go, but what little AI it can use is going to be nowhere near the individuality you need for each name. I fear the best way will be a one by one rename. Quote Link to comment Share on other sites More sharing options...
HiassofT Posted May 23, 2022 Share Posted May 23, 2022 MS PowerToys include a PowerRename tool https://docs.microsoft.com/en-us/windows/powertoys/powerrename And there's also third-party windows software like Bulk Rename https://www.bulkrenameutility.co.uk/ I haven't used either of these myself but the descriptions read like they should help with most of the boring leg-work. Personally, as a linux user, I use mmv on the command line to bulk rename files. so long, Hias Quote Link to comment Share on other sites More sharing options...
Mclaneinc Posted May 23, 2022 Share Posted May 23, 2022 The most useful bit of renaming software I have come across is RenameMaster, it's over flowing with options and can use regular expressions as well as other scripting ways. Best news, it's free.. http://www.joejoesoft.com/vcms/108/ Quote Link to comment Share on other sites More sharing options...
bfollowell Posted May 23, 2022 Share Posted May 23, 2022 9 minutes ago, HiassofT said: And there's also third-party windows software like Bulk Rename https://www.bulkrenameutility.co.uk/ I've used this one quite extensively, and it's quitre powerful, but I don't see how anything like this is going to work for you. I mean, you have hundreds, or thousands of files, with long filenames, likely several words per filename. There's going to need to be some intelligence there in order to rename those from multiple words to an 8.3 format. Like @Mclaneinc said, I fear you're going to need to roll up your sleeves and do this yourself unless you're wanting to do something simple like truncate everything after the 8th character, in which case, I'd say you're going to wind up with a bunch of identical filenames. Quote Link to comment Share on other sites More sharing options...
HiassofT Posted May 23, 2022 Share Posted May 23, 2022 Getting some meaningful 8.3 names most likely won't work without manual interaction. eg if you have "Donkey Kong", "Donkey Kong Junior" and "Donkey Kong Remix" you'll have to choose yourself how to resolve the shortening so you later know which one was which. The tools can help you to automate some boring task like removing embedded tags like [composer] (year) etc. RegEx and JavaScript might be useful to automate some of that and/or you could export a file list to csv, process that with calc/excel/whatever you're most familiar with, and semi-automatically and/or manually choose short file names there, then use the csv to rename the files. The csv approach with from and to columns might also be helpful if you later want to know what DONKGJR3.SAP actually was, just look it up there ? so long, Hias 1 Quote Link to comment Share on other sites More sharing options...
Ricky Spanish Posted May 23, 2022 Share Posted May 23, 2022 I use this. It looks into folders, subfolders, sub-sub folders, the whole 9 yards. https://www.digitalvolcano.co.uk/textcrawler.html Quote Link to comment Share on other sites More sharing options...
Rybags Posted May 23, 2022 Share Posted May 23, 2022 A rename that used the first 4-5 characters then generated a CRC from the remainder then converted it into legal filename characters would be what's needed maybe. Though you'd end up with unintelligible filenames in many cases. Alternatively just something that generated names with sequence numbers occupying the last 1-4 positions based on what was found in the input folders. Though isn't that how the earlier Win versions used to do it? I've got a program for Windows called "Bulk rename utility" - maybe it can help. Quote Link to comment Share on other sites More sharing options...
ivop Posted May 23, 2022 Share Posted May 23, 2022 4 hours ago, HiassofT said: Personally, as a linux user, I use mmv on the command line to bulk rename files. Seems it exists since November 2001. Why didn't I know about this? From the manpage: Rename all *.jpeg files in the current directory to *.jpg: mmv '*.jpeg' '#1.jpg' I used to do: for i in *.jpeg; do j=`basename "$i" .jpeg`.jpg; mv "$i" "$j"; done apt-get install mmv Thanks! Quote Link to comment Share on other sites More sharing options...
Gunstar Posted May 23, 2022 Share Posted May 23, 2022 I'd just delete it all and download the SAP archive again without making the same mistake twice. Quote Link to comment Share on other sites More sharing options...
phaeron Posted May 23, 2022 Share Posted May 23, 2022 Altirra does this mapping as part of its H:/PCL: support, so a cheesy way to do this is to map the directory and copy from one H:/PCL: to another. Unfortunately, we've found out recently that SDX's COPY /R does not work properly with PCL:, so you'd need to merge the folders and then resort back to alphabetical folders. Quote Link to comment Share on other sites More sharing options...
Mario D Posted May 24, 2022 Share Posted May 24, 2022 MS Windows keeps an 8.3 filename for every windows filename that is not already in 8.3 format. Open a CMD window and execute: dir/x You will see both the long name and the 8.3 name. You can use the 8.3 filename in commands: for example, if the long name is "This is a long name.txt" and the 8.3 name is "THIS~1.TXT", you can execute either of these commands and get the same output: type "This is a long name.txt" type THIS~1.TXT In a batch file subroutine, one can access the short name using the %~s1 parameter. See this: https://ss64.com/nt/syntax-args.html So, it wouldn't be too difficult to write a CMD script to rename or to copy (preferable to a different folder) the long file to the short name. And by using the 8.3 name that Windows assigned, you can always go back to reference it (as long as you don't rename or move the file to a new location). Alternatively, if you just want to rename them to something like FILE0001.xxx to FILE9999.xxx, a CMD script can simply use a FOR command loop and a counter to rename the files. I can help you write a script if you need it. Feel free to contact me. I don't access this forum too often, so reach me via email: atari@epic.email Quote Link to comment Share on other sites More sharing options...
Jetboot Jack Posted May 24, 2022 Share Posted May 24, 2022 If you use a Mac - then Name Changer is really useful. It has a wide range of substitution and string logic you can apply to file names - whilst I have not renamed 5000 files with it in one go I have done many long to 8.3 conversions using it. Like most of this thread says you are gonna have to get you hands dirty a bit, Name Changer makes complex and bulk renaming chores really simple. sTeVE Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.