Welcome Guest

Pages: 1
Moving characters from within a line of text, according to a pattern.
SnowdogPostJune 10, 2023, 06:02
Pro
Posts: 279
Registered:
March 15, 2022, 17:12
Normal topicMoving characters from within a line of text, according to a pattern.

So, super niche. But I'm wondering if it's possible to broaden it to something more generally useful.

As you can see from the screenshot below, sometimes the bit I need to move is buried within the line of text.

What I'm trying to do here is move the BWV number (the catalogue numbers for J. S. Bach's music) to the beginning of each line.

Often they're placed at the end & that previous action is perfect for moving them to the beginning.

But, I've just come across a set of 70-odd preludes & fugues where the BWV number is in the middle.

I can't do anything global with them, as each prelude/fugue pair has a different BWV number.

I can't use the Remove & Insert function for all of them at once, because the number of characters before it varies each time.

So, what if I had an action where I could ask it to start at a certain thing (in this case "BWV" but it might be a K or K. if it were a Mozart set) & remove a certain amount by a second setting?

In terms of this specific situation, instructing it to remove a certain number of characters would suffice.

What I'm wondering is what other secrets might Yate hold that I don't know about?

A "one size fits all" action might not be possible but I'd appreciate your thoughts on the matter.

Plus, I'm probably over-thinking it. 😆

Image

2MR2PostJune 10, 2023, 08:23
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicMoving characters from within a line of text, according to a pattern.

This is the issue with little snippets and not having the full picture. There is a somewhat esoteric action statement which decomposes a title into it's component classical parts. Decompose Title into Classical Metadata. The components are work, part, movement, movement number, opus and catalog. If this statement works with your titles it can be used to extract the catalog and reorder the parts however you wish.

I'm not going to manually recreate test data from the screenshot. Far too much typing. Download the Dump Metadata action from the web resources page. Load and select the file; run the action then email me the produced zip file to support@2manyrobots.com. I'll have a look.

2MR2PostJune 11, 2023, 12:30
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicMoving characters from within a line of text, according to a pattern.

I played with this a little. As the action is based on documented catalogs, I don't really need your sample files. Download:

https://2manyrobots.com/actions/Extract-Classical-Catalog-and-Move-to-the-Front.zip

It uses Yate's classical decomposition capabilities to move the catalog to the front. The action is called: Extract Classical Catalog and Move to the Front

This one will only prompt you for a separator. If you want to change the separator, start the action with the Shift key pressed. Using Shift will avoid the 'little menu' from being displayed (at its default settings).

As before the action will work stand alone (using Title) or from the Multi Field Editor or a field's function button.

Give it a try.

SnowdogPostJune 12, 2023, 03:36
Pro
Posts: 279
Registered:
March 15, 2022, 17:12
Normal topicMoving characters from within a line of text, according to a pattern.

Apologies for the delay in replying. (As always, it doesn't matter how often I hit "subscribe", sometimes I just don't get subscribed to replies.)

As a result, I was beginning think that my nonsensical request was a bit rambling & abstract, so thanks for this. I'll give it a go.

SnowdogPostJune 12, 2023, 04:22
Pro
Posts: 279
Registered:
March 15, 2022, 17:12
Normal topicMoving characters from within a line of text, according to a pattern.

On another tack, one of the issues I have when I pick up these box sets in that the tagging is completely inconsistent between discs. It's like every disc has been tagged by a different person sometimes, so it's very rarely the case that I would have all of the information required to make an action work over the whole thing.

This Bach set is a perfect example. Very often the track titles are truncated, sometimes the catalogue numbers are not even included, etc.

One of the first things I always do is to sort out the folder structure in the finder, including all the extra information I like to have, such as the Discogs number. I often have to go & find good sleeve art, too, and name it accordingly. So, as you can imagine, for a 172 disc set like this, there's quite a lot of work to do before I get to Yate.

What that initial work does allow me to do it to sort by Path so that everything's in the correct order in Yate. This helps with track & disc numbering shortcuts, sleeve art, etc. It also means I can copy the folder names in as the album titles, which in turn means I can copy & paste the Discogs number into a browser & get directly to the track list for any missing information, without going back into the finder.

This unfortunately leaves me with these annoying snippet requests. You know, these three discs have the catalogue number like this, these have it like that, here someone's used colons, here they haven't used anything, this lot have the composer's name at the beginning of the title, etc. etc.

I've got to the point in Yate where I'm able to get most things to where I want them in fairly short order, using the existing tools more effectively (as well as the many actions I now have, thanks to you), but there's always something to trip me up in the larger sets!

2MR2PostJune 12, 2023, 07:56
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicMoving characters from within a line of text, according to a pattern.

One possibility is to use the MusicBrainz wizard to search for the box set. The have guidelines for the formatting of Title fields in classical releases. If you can find the correct release, importing the Title field (and whatever else you want) might get you consistent data.

SnowdogPostJune 14, 2023, 03:23
Pro
Posts: 279
Registered:
March 15, 2022, 17:12
Normal topicMoving characters from within a line of text, according to a pattern.

This works perfectly, thank you!

SnowdogPostJune 26, 2023, 14:38
Pro
Posts: 279
Registered:
March 15, 2022, 17:12
Normal topicMoving characters from within a line of text, according to a pattern.

So this seems to have stopped working. (In other words, what am I doing wrong? It'll be something stupid, I know it.)

I can't figure out why the catalogue numbers in the screen shot aren't being moved?

Image

2MR2PostJune 26, 2023, 15:02
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicMoving characters from within a line of text, according to a pattern.

The parser is based on the MusicBrainz classical formatting for Title. The two colons (:) in the title are confusing the parser.

If the first colon is replaced with anything else, it will work fine.

You can easily do this in the MFE as in the attached screenshot.

If you want I can modify the action to replace all colons except the last to a - or whatever you'd like.

Image

SnowdogPostJune 26, 2023, 15:10
Pro
Posts: 279
Registered:
March 15, 2022, 17:12
Normal topicMoving characters from within a line of text, according to a pattern.

Ah, right!

The colons were up against the cat no. so I moved them away, assuming a word space clearance would do the trick.

Thanks! 🙂

Pages: 1
Mingle Forum by Cartpauj | Version: 1.1.0beta | Page loaded in: 0.015 seconds.