Is there anyway to stop MAKEMKV putting in the underscore (_) instead of spaces in the file name (on Windows)? Just wonder if there's a way to stop me renaming the files afterwards
![Smile :)](./images/smilies/icon_smile.gif)
Yours
Jonathan
Agreed, I'd like to see it be the same as the name but at least it isn't a big deal to change (in expert mode anyway). Just a bit of cut and pasting now (create folder with name (Movie Name (year)), paste into name, paste into file name). Probably would be good for folks who don't know that mode exists to have it default that way. I don't know of any systems in use today that you would play it on that would have issues with long file names and spaces.Woodstock wrote:This is a much-requested option...
For what it is worth, if you have expert mode enabled, you can edit the file names BEFORE you create the files.
Changing a file's name to title case is an option in Handbrake. I'm not sure which way the default is, but I have it disabled since I edit the source file name before I feed it to Handbrake.Yugatha wrote:It may or may not help your circumstances, but I personally encode my rips afterwards with Handbrake, which automatically a) Replaces Underscores with Spaces, and b) up's the filename to title-case (ie Auto-Capitalises the first letter of each word. This also has the advantage of shrinking the video file with very little (if any) noticeable quality loss.
I always rename the tracks before I rip, but have _ in the file name anyway. I use the _ to help tell my MakeMKV files from files that have been run though handbrake.Woodstock wrote:This is a much-requested option...
For what it is worth, if you have expert mode enabled, you can edit the file names BEFORE you create the files.
... same to me, so why does MakeMKV still replace all the spaces or dots (and maybe more) in my output-filename with underscores, although I have renamed it before ripping?KiltedShane wrote: I always rename the tracks before I rip, but have _ in the file name anyway.
Code: Select all
<#
Arthor: Michael A. Gates
contact: mikeisfly on the makemkv forum
This file was created to make your life of backing up Blu-ray(s) and DVD(s) you legally own
a little more easier. I take no responsibility if you delete your files or cause any damamge to your
System. Use at your own risk.
In order for you to execute this script follow the instructions below:
1. Copy code into your favorite text editor
2. Change the varible $dir1 to your direcotry
3. Save the file to whatever you you want with a .ps1 extension
4. Execute the script by typing the name of the script with the full path name
5. Enjoy!
*Note you may have to enable your system to run unsigned scripts by executing the following command
from a powershell window: set-executionpolicy remotesigned
#>
<#
The purpose of this powershell script is to rename the output file from MakeMKV which uses "_"
in the filename and replaces them with a " " which looks much nicer. It will also get rid of
the "_tXX" at the end of the file which indicates the track your ripped from your backup.
Finially the script will create a folder based on the new filename and then move that file into that
folder. If the files are already renamed then the script will just create a folder under the directory
which is defined by the $dir1 varible and move the matching file to that folder. I put logic in the
script to ignore all files except those ending in .mp4 or .mkv
#>
$searchstring1="_"
$searchstring2="_t"
$searchstring2reset=$searchstring2
$replacestring1=" "
$replacestring2=""
$dir1="f:\video" # Change this varible to the folder where your files are located
$FileExtension1=".mkv"
$FileExtension2=".mp4"
$fileEntries = [IO.Directory]::GetFiles($dir1)
foreach($fileName in $fileEntries)
{
if ($fileName.Contains($FileExtension1) -or $fileName.Contains($FileExtension2))
{
$test=$fileName.subString(($fileName.length)-8,2)
if ($test -eq $searchstring2)
{
$searchstring2=$fileName.subString(($fileName.length)-8,4)
$fileNameTemp = $fileName.replace($searchstring2, $replacestring2)
}
else{$fileNameTemp=$fileName}
$fileNameTemp = $fileNameTemp.replace($searchstring1, $replacestring1)
if (!($fileNameTemp -eq $fileName)){Rename-Item $fileName $fileNameTemp}
$NewDir = $fileNameTemp -replace ".{4}$"
if (!(Test-Path $NewDir))
{
if ($NewDir.Length -gt 0){New-Item -ItemType Directory -Force -Path $NewDir | Out-Null}
}
Move-Item $fileNameTemp $NewDir
$searchstring2=$searchstring2reset
}
}
All good suggestions, I will implement those as soon as I get sometime. Thanks for the ideasYugatha wrote:Seeing as how this thread is revived anyway...
@mikeisfly... the script looks ok, but I'd like to make a few suggestions.
1) Check to mark sure the length is at least 8 before taking the substring. Not too sure how well Powershell would handle it, but at the worst case, it could mess up the operation of the script
2) It's rare, but there is the possibility of the _txx number to be 3 digits (ie _txxx) - maybe this could be implemented?
3) I'd suggest holding off on renaming the file until the move - ie, rename the file at the same time as the move. There is the (extremely rare, but possible) chance that the file "movie.mkv" exists when renaming "movie_t01.mkv" in the same folder. If you check to make sure it doesn't exist first, then move it, it would be much safer.
Apart from that, thanks for contributing!