More > JRiver Media Center 25 for Mac

Batch replace tag conent

<< < (6/7) > >>

blgentry:
I can't help a lot with the crash, but I'll say this:

Try rebooting your computer and then relaunching MC.  If the problem persists, the developers will probably want to see an MC log.  This is not the same as the crash log that comes up as a pop up.  It's a separate MC logging facility that you have to enable.  Details in the Wiki:

https://wiki.jriver.com/index.php/Logging

I'll answer the other question in a separate reply.

Brian.

blgentry:

--- Quote from: HaWi on October 31, 2019, 02:33:34 pm ---I have a few albums where track names contain text01, text01, text03, ..., text10, and I'd  like to remove those altogether like =Replace([Name],text??,text) where the ? would be the wild card for a single character at that position.

--- End quote ---

That's a nearly perfect job for regex.  Let's see...  If there's DEFINITELY nothing after the digits that you want, then something like this will work:


--- Code: ---regex([Name],/#^([^\d]+)\d+#/,-1,0)[R1]
--- End code ---

I've only done a quick little test on this, so it migth not be perfect.  You should learn how these work.  Let me break this one down for you:

/# :  Start of the REGEX
^ : this marks the start of the field.  This is important because it anchors the expression to the very beginning of the line
( stuff stuff stuff ) :  These parenthesis separate off something I want to save for later... in this case it's the text without the digits.  Inside those parenthesis we have:
[^\d]+ :  [ and ] define a range of characters.  In this case I'm saying "\d" which means "digits".  But what's that ^ character before it?  That means to invert the match.  So everything EXCEPT for digits are the characters I want to match.  Now there's a + outside of the [] .  The + means to match on one or more instances of this character (which is not a digit).  Whew.
\d+ :  You guessed it, this means I want to see one or more digits *after* I match the stuff before it.
/# :  End of the REGEX

The net effect is that I grab all the stuff before the digits, but not the digits themselves.  Those are saved into my first "buffer", R1.  So at the end of the expression, I put in [R1], which makes it print the value of R1.  Done!

Give it a try and see if it works for you.

Brian.

HaWi:

--- Quote from: blgentry on October 31, 2019, 03:18:05 pm ---I can't help a lot with the crash, but I'll say this:

Try rebooting your computer and then relaunching MC.  If the problem persists, the developers will probably want to see an MC log.  This is not the same as the crash log that comes up as a pop up.  It's a separate MC logging facility that you have to enable.  Details in the Wiki:

https://wiki.jriver.com/index.php/Logging

I'll answer the other question in a separate reply.

Brian.

--- End quote ---

Thank you Brian!
I haven’t had a crash since so I’ll blame it on a Catalina quirk.

Cheers
Hans

HaWi:

--- Quote from: blgentry on October 31, 2019, 03:29:06 pm ---That's a nearly perfect job for regex.  Let's see...  If there's DEFINITELY nothing after the digits that you want, then something like this will work:


--- Code: ---regex([Name],/#^([^\d]+)\d+#/,-1,0)[R1]
--- End code ---

I've only done a quick little test on this, so it migth not be perfect.  You should learn how these work.  Let me break this one down for you:

/# :  Start of the REGEX
^ : this marks the start of the field.  This is important because it anchors the expression to the very beginning of the line
( stuff stuff stuff ) :  These parenthesis separate off something I want to save for later... in this case it's the text without the digits.  Inside those parenthesis we have:
[^\d]+ :  [ and ] define a range of characters.  In this case I'm saying "\d" which means "digits".  But what's that ^ character before it?  That means to invert the match.  So everything EXCEPT for digits are the characters I want to match.  Now there's a + outside of the [] .  The + means to match on one or more instances of this character (which is not a digit).  Whew.
\d+ :  You guessed it, this means I want to see one or more digits *after* I match the stuff before it.
/# :  End of the REGEX

The net effect is that I grab all the stuff before the digits, but not the digits themselves.  Those are saved into my first "buffer", R1.  So at the end of the expression, I put in [R1], which makes it print the value of R1.  Done!

Give it a try and see if it works for you.

Brian.

--- End quote ---

Thank you Brian!

This look pretty complicated. I’ll give it a go. Is have to admit I was not precise enough, though. There is almost always some more text after the few characters I’d like to delete. So it really looks like this:

word ... word01 word word
where I’d like to delete only the 01

I’ll have another go at looking at the Regex rules but I might be faster doing it manually.

As always, thank you so much for your help!

Best wishes,
Hans

blgentry:

--- Quote from: HaWi on November 01, 2019, 12:26:43 pm ---This look pretty complicated. I’ll give it a go. Is have to admit I was not precise enough, though. There is almost always some more text after the few characters I’d like to delete. So it really looks like this:

word ... word01 word word
where I’d like to delete only the 01

--- End quote ---

Here's another regex that *might* remove cases like you described above.  This is untested:


--- Code: ---regex([Name],/#^([^\d]+)\d+([^\d]*)$#/,-1,0)[R1][R2]
--- End code ---

This will only work if the "stuff" after the 01 has no digits.

Good luck.

Brian.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version