Special characters in replacement matrix
-
- Newbie
- Posts: 9
- Joined: Thu Jul 31, 2014 10:05 pm
- Location: Montauban, France
Special characters in replacement matrix
Hello, I've been using TGF for a few years now, and I'm a bit struggling with the new formatting options.
Specifically I've got a problem with the replacement matrix. When I set a character (or word) to match and replace, it generally works, except for the two ones I'd really like to replace !
That is ':' and '/'. The new version just doesn't find them although they really occur in the tag fields.
This used to work like a charm in the previous version (0.72 I think, it was on my older PC).
Is there a new mechanism I haven't understood ?
Specifically I've got a problem with the replacement matrix. When I set a character (or word) to match and replace, it generally works, except for the two ones I'd really like to replace !
That is ':' and '/'. The new version just doesn't find them although they really occur in the tag fields.
This used to work like a charm in the previous version (0.72 I think, it was on my older PC).
Is there a new mechanism I haven't understood ?
Re: Special characters in replacement matrix
Please make sure that in your workflow you have a task with a matrix,
in the lower part of the screen select your created matrix in the 'task parameters' and in the 'apply to' list check the fields you want to format.
in the lower part of the screen select your created matrix in the 'task parameters' and in the 'apply to' list check the fields you want to format.
-
- Newbie
- Posts: 9
- Joined: Thu Jul 31, 2014 10:05 pm
- Location: Montauban, France
Re: Special characters in replacement matrix
Well that's what I'm doing and this works for any word I've tried… but not for these two characters !
Thanks for the reply though
Thanks for the reply though
Re: Special characters in replacement matrix
Can you send me your tgf.ini file so I can reproduce if possible?
Also what Windows version are you using
Also what Windows version are you using
-
- Newbie
- Posts: 9
- Joined: Thu Jul 31, 2014 10:05 pm
- Location: Montauban, France
Re: Special characters in replacement matrix
Alright, here it is.
I'm running Windows 7 64bit.
(And btw, it really hates when I hit the "Alt Gr" key, an error window pops "Access violation as address 00000000. Read of address 00000000." But this is not that much trouble)
I'm running Windows 7 64bit.
(And btw, it really hates when I hit the "Alt Gr" key, an error window pops "Access violation as address 00000000. Read of address 00000000." But this is not that much trouble)
- Attachments
-
- tgf.7z
- (3.88 KiB) Downloaded 695 times
Re: Special characters in replacement matrix
In your workflow you need to select the fields you would like to update, only filename is selected in the matrix task (the default), check all the tag fields that you are using
-
- Newbie
- Posts: 9
- Joined: Thu Jul 31, 2014 10:05 pm
- Location: Montauban, France
Re: Special characters in replacement matrix
I did that, actually the filename is the only one to be changed in that case (and that's precisely because / and : are not allowed in filenames that I want them replaced).
But the settings are right anyway, because if I change the character '/' in the matrix to any word (that appears in the files of course) and make no other change then the filename is modified accordingly.
But the settings are right anyway, because if I change the character '/' in the matrix to any word (that appears in the files of course) and make no other change then the filename is modified accordingly.
-
- Sr. Member
- Posts: 294
- Joined: Wed Sep 15, 2010 1:38 pm
Re: Special characters in replacement matrix
Maybe the Options - Edit - Rename - Illegal characters - Remove/Replace action happens before the Workflow & Replacement matrix action on filename. It isn't possible to disable the illegal character rename.
-
- Newbie
- Posts: 9
- Joined: Thu Jul 31, 2014 10:05 pm
- Location: Montauban, France
Re: Special characters in replacement matrix
Exactly ! Now it works indeed, thank you for this answer.hopalongrock wrote:Maybe the Options - Edit - Rename - Illegal characters - Remove/Replace action happens before the Workflow & Replacement matrix action on filename. It isn't possible to disable the illegal character rename.
It would be better if we could disable this behaviour or set specific replacements for individual illegal characters but still. Maybe have the possibility to apply the matrix before the automatic removal?
At least I understand what's happening and this can be worked around now.
Re: Special characters in replacement matrix
In that case you can use variable scripts to override the illegal character replacement.
You need to go to options/formatting/variables and in the user tab click 'manage..' in the script section and paste this code
Save the file (for example) as art.scv
Now in the filename format string I see you use something like %A% - %Y% - %L% - %R% - %T% replace with %@art.scv% - %Y% - %L% - %R% - %T%, as you can see the artist variable is now using the script above.
So when the filename is constructed it will receive a formatted string that replaces ':' with ' --' as you have set in your matrix.
You must alter the default matrix though because it replaces '--' with ''
Following the above example you can do the same with %L% and %T%.
Now you only need to take care of the '/' character so in the illegal rename character option set 'replace with..' to '-'
You need to go to options/formatting/variables and in the user tab click 'manage..' in the script section and paste this code
Code: Select all
begin
var_result( AnsiReplaceText( gTag.Artist, ':', ' --' ) );
end.
Now in the filename format string I see you use something like %A% - %Y% - %L% - %R% - %T% replace with %@art.scv% - %Y% - %L% - %R% - %T%, as you can see the artist variable is now using the script above.
So when the filename is constructed it will receive a formatted string that replaces ':' with ' --' as you have set in your matrix.
You must alter the default matrix though because it replaces '--' with ''
Following the above example you can do the same with %L% and %T%.
Now you only need to take care of the '/' character so in the illegal rename character option set 'replace with..' to '-'
-
- Newbie
- Posts: 9
- Joined: Thu Jul 31, 2014 10:05 pm
- Location: Montauban, France
Re: Special characters in replacement matrix
Ah yes this is a good idea thank you !
And many thanks for this very nice piece of software of course.
And many thanks for this very nice piece of software of course.
Re: Special characters in replacement matrix
I had a look at the new code and there is actually a glitch with illegal chars and the workflow.
Your original matrix should work in the first place, will try and sort this out in the next beta to make the behavior more straightforward.
Your original matrix should work in the first place, will try and sort this out in the next beta to make the behavior more straightforward.
-
- Newbie
- Posts: 9
- Joined: Thu Jul 31, 2014 10:05 pm
- Location: Montauban, France
Re: Special characters in replacement matrix
Ah good !
Then my little problem will have been useful somehow.
Then my little problem will have been useful somehow.