Delete last 12 characters of file names in external hard drive folder.

S.H.A.D.O.

Well-known Member
Joined
Sep 6, 2005
Messages
1,915
Good afternoon,

I have an external hard drive with a folder named MP4. Within that folder there are about 500 MP4 files. What I would like to do is to delete the last twelve characters from EACH of the filenames. The 12 characters are firstly a SPACE, then followed by [abcwdefgh] for example including the brackets, the 12 characters are IDENTICAL at the end of EACH file though. Is there an easy way to do this please without the need to edit every single one?.

Thanks in advance.
 
Just a follow up to this topic for anyone following this either now or in the future.

I have done some more testing, obviously because of the huge number of files involved.

wigi's works perfectly INCLUDING if there is a full stop within the filename itself (excluding the .mp4 extension of course), but MUST only be run ONCE, because otherwise it deletes a further 12 characters.

apo's works perfectly EXCLUDING if there is a full stop within the filename itself (excluding the .mp4 extension of course), but MUST only be run ONCE, because otherwise it deletes a further 12 characters. If you run it and it has a full stop within the filename itself (excluding the .mp4 extension of course), it corrupts the filename and the file is unloadable.

Once again, thanks to wigi and apo for their efforts, it is appreciated.
 
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
You're welcome ! Thanks for the feedback.
 
Upvote 0
Hi.. Thanks for the detailed reply..

Both issues/annoyances you mention could be coded for.. as your filenames have a constant syntax.. :)
 
Upvote 0
Thank you both, it is appreciated.

It would be interesting at some stage to be able to put the actual text that needs to be deleted at the end of the filenames in the code, that way it will overcome any discrepencies. But that is something maybe for another day in the future.

Cheers!
 
Upvote 0

Forum statistics

Threads
1,215,401
Messages
6,124,705
Members
449,182
Latest member
mrlanc20

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top