Jump to content
IGNORED

rename from <256 chars into 8.3 filenames


Recommended Posts

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...

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...