Please take a minute to check our Frequently Asked Questions. Use Search to reveal possible related topics.
Also make sure you've read the Forum Guidelines before posting in this forum.
![]() ![]() |
Jul 23 2012, 15:01
Post
#1
|
|
|
Member Group: Full Members Posts: 39 Joined: 19-July 12 Member No.: 16700 Mp3tag Version: 2.52 |
How would I do this in album titles and track titles?
I suppose I have to write an action that would find straight quotes with text or numbers on each side of them and replace it with curly quotes, but I don't know how to find that. |
|
|
|
Jul 23 2012, 15:33
Post
#2
|
|
|
Member Group: Members Posts: 4 Joined: 23-July 12 Member No.: 16714 Mp3tag Version: v2.52 |
Maybe use a specialized mass file rename application like: Name It Your Way (NIYoW)
|
|
|
|
Jul 23 2012, 16:04
Post
#3
|
|
![]() Moderator Group: Moderators Posts: 5506 Joined: 4-September 03 From: Germany Member No.: 201 Mp3tag Version: 2.55a |
Mp3tag can do it.
Make a new action: Action type: Replace with regular expression Field: TITLE Regular expression: "([^"]+)" Replace matches with: “$1” [ ] case-sensitive comparison -------------------- |
|
|
|
Jul 23 2012, 16:32
Post
#4
|
|
|
Member Group: Full Members Posts: 39 Joined: 19-July 12 Member No.: 16700 Mp3tag Version: 2.52 |
Works great, thanks. A few questions, though:
Can I do it for more than one field with the same action, or do I have to make one action for each field? What does the + mean? And how does it know which quote to replace with “ and which with ” ? |
|
|
|
Jul 23 2012, 18:01
Post
#5
|
|
![]() Moderator Group: Moderators Posts: 5506 Joined: 4-September 03 From: Germany Member No.: 201 Mp3tag Version: 2.55a |
You'll have to make one for each field. Or if you want to change all tags fields you can use _TAG
-------------------- |
|
|
|
Jul 23 2012, 20:46
Post
#6
|
|
|
Member Group: Full Members Posts: 39 Joined: 19-July 12 Member No.: 16700 Mp3tag Version: 2.52 |
And I assume this would work for single quotation marks:
'([^']+)' ‘$1’ EDIT: For some reason it doesn't EDIT 2: The reason was it was mixing them up with apostrophes, so I wrote this and it seems to be working: Regular expression: '\b([^']+)\b' Replace matches with: ‘$1’ Now, is that a good expression or it might mess up something else? EDIT 3: Nope, it thinks that the apostrophes in the words like can't are on a word boundary This post has been edited by aax: Jul 24 2012, 00:29 |
|
|
|
Jul 24 2012, 07:05
Post
#7
|
|
![]() Member Group: Full Members Posts: 4129 Joined: 26-May 06 From: Wuppertal, Germany, Planet Earth Member No.: 3194 Mp3tag Version: 2.54 |
And I assume this would work for single quotation marks: '([^']+)' ‘$1’ ... Read there ... Characters with special functionality ... http://help.mp3tag.de/main_scripting.html Try one of this expressions ... $regexp($regexp(%TITLE%,'('''')\b','\x{2018}'),'\b('''')','\x{2019}') $regexp(%TITLE%,'''([^'''']+)''','\x{2018}$1\x{2019}') $regexp(%TITLE%,'''([^'''']+)''','‘$1’') $regexp(%TITLE%,''('['^''']'+)'','‘$1’') Or use actions ... Begin Action Group Test_2012#20120724.Single.Double.Quote Action #1 Actiontype 5: Format value Field ______: TEST1 Formatstring: Raised ''On'' Rock Action #2 Actiontype 4: Replace with regular expression Field ______________: TEST1 Regular expression _: '([^']+)' Replace matches with: ‘$1’ [_] Case sensitive comparison Action #3 Actiontype 5: Format value Field ______: TEST2 Formatstring: Raised "On" Rock Action #4 Actiontype 4: Replace with regular expression Field ______________: TEST2 Regular expression _: "([^"]+)" Replace matches with: “$1” [_] Case sensitive comparison End Action Group Test_2012#20120724.Single.Double.Quote (4 Actions) ... will give the result ... TEST1 = Raised ‘On’ Rock TEST2 = Raised “On” Rock ... what leads to the question ... Why have the single quote to be written twice in the "Format string" edit field of the action "Format value" to become a single quote once in the tag-field? Has there some new inconsistency coming up in Mp3tag? _________________________________________ Having strings like ... Cannot raise "on" rock. Can't raise "on" rock. ... giving results like ... Cannot raise “on” rock. Can't raise “on” rock. ... this might work ... $regexp(%TITLE%,'(^|\s)\x22([^\x22]+)\x22(\s|$)','$1\x{201C}$2\x{201D}$3') Having strings like ... Cannot raise 'on' rock until dawn. Can't raise 'on' rock 'til dawn. ... giving results like ... Cannot raise ‘on’ rock until dawn. Can't raise ‘on’ rock 'til dawn. ... this might work ... $regexp(%TITLE%,'(^|[\s.,;:])\x27([^\x27]+)\x27([\s.,;:]|$)','$1\x{2018}$2\x{2019}$3') DD.20120724.1055.CEST This post has been edited by DetlevD: Jul 24 2012, 09:56 -------------------- * Beyond that, don't ask, when you don't know what to do with the answer. *
♥ home is where the heart is ♥ |
|
|
|
Jul 24 2012, 17:18
Post
#8
|
|
|
Member Group: Full Members Posts: 39 Joined: 19-July 12 Member No.: 16700 Mp3tag Version: 2.52 |
QUOTE .. giving results like ... Cannot raise “on” rock. Can't raise “on” rock. ... this might work ... $regexp(%TITLE%,'(^|\s)\x22([^\x22]+)\x22(\s|$)','$1\x{201C}$2\x{201D}$3') Having strings like ... Cannot raise 'on' rock until dawn. Can't raise 'on' rock 'til dawn. ... giving results like ... Cannot raise ‘on’ rock until dawn. Can't raise ‘on’ rock 'til dawn. ... this might work ... $regexp(%TITLE%,'(^|[\s.,;:])\x27([^\x27]+)\x27([\s.,;:]|$)','$1\x{2018}$2\x{2019}$3') The expression for double quotes works, but the last one (for single) doesn't. |
|
|
|
Jul 24 2012, 17:53
Post
#9
|
||
![]() Member Group: Full Members Posts: 4129 Joined: 26-May 06 From: Wuppertal, Germany, Planet Earth Member No.: 3194 Mp3tag Version: 2.54 |
The expression for double quotes works, but the last one (for single) doesn't. Hm, for me it works ... see picture ... ... or is there some misunderstanding of the problem to be solved? DD.20120724.1850.CEST This post has been edited by DetlevD: Jul 24 2012, 17:57 -------------------- * Beyond that, don't ask, when you don't know what to do with the answer. *
♥ home is where the heart is ♥ |
|
|
|
||
Jul 24 2012, 18:14
Post
#10
|
|
|
Member Group: Full Members Posts: 39 Joined: 19-July 12 Member No.: 16700 Mp3tag Version: 2.52 |
Sorry, it is working, I just didn't copy it correctly.
By the way, how would I find and replace three dots (...) with ellipsis, but only when there are exactly three dots and not when they are in a sequence with more than three dots (.........) I found a link to some slideshow about regular expressions that you posted and I tried this: Regular expression: (?<=[^\.])\.{3}(?!.) Replace matches with: … but it doesn't work. And when i try it with just negative lookahead it works but it replaces the last three dots only in sequences with more than three dots. Regular expression: \.{3}(?!.) Replace matches with: … This post has been edited by aax: Jul 24 2012, 18:36 |
|
|
|
Jul 24 2012, 19:36
Post
#11
|
|
![]() Moderator Group: Moderators Posts: 5506 Joined: 4-September 03 From: Germany Member No.: 201 Mp3tag Version: 2.55a |
Try it this way:
(?<!\.)\.{3}(?!\.) -------------------- |
|
|
|
Jul 24 2012, 19:55
Post
#12
|
|
|
Member Group: Full Members Posts: 39 Joined: 19-July 12 Member No.: 16700 Mp3tag Version: 2.52 |
Well I'll be damned... It's working!
I'll have to get some glasses. Oddly enough, when I was fooling around with it yesterday I had the \ in the negative lookahead and must have forgotten to put it in the positive lookbehind and that's why it was only working with the last three dots in the multi-dot sequence. And now I mistyped it again in the last post |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 25th May 2013 - 05:07 |