Substitution file tweak

All your suggestions, requests and ideas for future development
Post Reply
ChefGregS
Posts: 99
Joined: 30 Mar 2016, 11:14

Substitution file tweak

Post by ChefGregS »

Would it be possible to have substitution files follow a little different format?

Currently you use 1 line for 1 sub. Couldn't 1 line be used for multiple subs ending in the same value?

In other words:

Current:
Sub ; Result
---------------------------
Not Rated; NR
no rating; NR
N.R.; NR

New:
Result Sub(s)
----------------------------
NR; Not Rated;no rating;N.R.


Put what you want the final result to be as the first item and then everything after that on that line will modify to the first item (result.) All SUB values (not the result value) should be case insensitive.

It may not make sense to some to change to this method but there are other apps that rename that use this same format. I found one of mine from a couple years ago where I had already added 100's of band name fixes. I would love to use this file for my music library and NOT have to redo it all again. Sounds a bit selfish on my part...I know...but hey, never hurts to ask! :) I know if I were coding this in BASIC it would take about 5 lines of code...but as I remember, if I did this in assembler it would be about 80 lines.. LOL!!!! And run 100 times faster! So, not sure if this is a huge pain for you, Rednoah... But again, wanted to at least ask... Doing multiple on one line seems more efficient at the least.

Greg
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Substitution file tweak

Post by rednoah »

Yes, of course. It's your format after all. It's probably gonna be one line, but it's most easy for you because you know exactly what you want. ;)

Here's an example, but there's probably a Groovy-ier way to write this:

Code: Select all

{
	def m = [:]
	def csv = ['NR': 'Not Rated;no rating;N.R.']

	csv.each{ k, v -> 
		v.split(';').each{ vk -> 
			m[vk] = k
		}
	}

	m['Not Rated']
}
:idea: Please read the FAQ and How to Request Help.
Post Reply