Need to shorten too many files to do folder by folder

Post any Bulk Rename Utility support requirements here. Open to all registered users.

Need to shorten too many files to do folder by folder

Postby SampleHead » Wed Dec 13, 2017 12:30 am

I am transferring wave files from PC to an Akai hardware sampler. Its ancient (2007) and can only handle 16 character filenanes plus '.wav'.

I have thousands of samples which are all too long and there are over a hundred folders - I am not going to customize renaming for each folder.

Each folder has files which all have identical starting characters, but the length of that indentical part varies from folder to folder. How can I rename the files to be no more than 16 chars long and contain the last part of the filename? And I want to do the entire subfolder tree in one go, not folder by folder.
SampleHead
 
Posts: 3
Joined: Wed Dec 13, 2017 12:23 am

Re: Need to shorten too many files to do folder by folder

Postby therube » Wed Dec 13, 2017 7:45 am

1:RegEx
Code: Select all
Match:  (.{16}$)
Replace:  \1


That will give you the final 16-characters.

Anything determinable with your "identical starting characters", or what follows.
Have a space or dash or ... that you can key in on?
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm

Re: Need to shorten too many files to do folder by folder

Postby SampleHead » Wed Dec 13, 2017 8:44 am

This is a great help! The original files currently look like this:-

wadm_808_kick_001_clean.wav
wadm_808_kick_001_drive.wav
wadm_808_kick_001_drive2.wav
wadm_808_kick_002_clean.wav
wadm_808_kick_002_drive.wav
wadm_808_kick_002_drive2.wav

All these files open up the same file because to the OS they are all named wadm_808_kick_00.wav You RegEx changes this to

8_kick_001_clean.wav
8_kick_001_drive.wav
_kick_001_drive2.wav
8_kick_002_clean.wav
8_kick_002_drive.wav
_kick_002_drive2.wav

Which is a mess but every filename is at least unique.

All the samples start with 'wa**_' and another section '*****_' (variable length) but after that the name can still exceed 16 chars.

EDIT: one is waot_groove-abstract_124_femalevocalmash_A.wav which truncates to emalevocalmash_A.wav

So I'm going to go with ugly but unique.

Many thanks!
SampleHead
 
Posts: 3
Joined: Wed Dec 13, 2017 12:23 am

Re: Need to shorten too many files to do folder by folder

Postby therube » Wed Dec 13, 2017 2:01 pm

(Not sure if this is "clean" code, but it works for the particular files you've shown.)

1:RexEx
Code: Select all
Match:  (.*_.*_.*_)(\d\d\d_.*)
Replace:  \2
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm

Re: Need to shorten too many files to do folder by folder

Postby SampleHead » Thu Dec 14, 2017 1:17 am

Not every file has 4 underscores (there are many many folders) so it leaves the filename unchanged. And sometimes the right most part is longer than 16 chars so it needs to be cut off anyway.
SampleHead
 
Posts: 3
Joined: Wed Dec 13, 2017 12:23 am


Return to BRU Support