Welcome Guest

Pages: 1
Adding sequential integers to selected lines
SnowdogPostJanuary 10, 2023, 12:14
Pro
Posts: 279
Registered:
March 15, 2022, 17:12
Normal topicAdding sequential integers to selected lines

Hi & a happy new year!

When tagging vinyl, I like to preserve the A & B side numbering in the track titles. (Standard numbering is then added to the files on my hard drive before the A & B side numbering, but I can do that part!)

Is it possible to select a set of lines & number them in a given place?

In the attached screenshot, I've added the A & B with a double full stop after.

Now I'm thinking I could "find & replace" each ".." with 01, 02 etc.

Does a command exist to do that?

If not could one be written?

Or perhaps something already exists that would do the same thing but differently to how I have it set up? (A kind of "how would you do it?" scenario.)

I can work around it by creating a two disc set, numbering each "disc" from 1, throwing that numbering into the file names, copying the file names to the track titles, adding A & B in front, deleting the disc numbering, renumbering the tracks for a single disc & then throwing the new track & disc numberings back onto the file names, but some kind of action or existing process would be quite a bit less fiddle.

The second screenshot is the end result that I'm after.

Image
Image

2MR2PostJanuary 10, 2023, 13:49
Avatar photo
Administrator
Posts: 2083
Registered:
August 23, 2012, 19:27
Normal topicAdding sequential integers to selected lines

Happy New Year to you as well.

I've uploaded an action bundle to:

https://2manyrobots.com/actions/Vinyl-Side-and-Number-to-Title.zip

The actions were written in Yate v6.13.1 which was released today. You'll have to update to run it.

There are two actions. The first named Sequentially Number Title Based on a Leading Token does what you requested. All selected tracks where the Title field begins with

upper case alpha..space

or

upper case alpha##space (where # is any decimal digit)

will be numbered. The ## form ensures that the action can be run more than once.

Note that the order of the first character (the side) is not significant. This means that A and B can be interspersed and yet the line numbers will still be allocated sequentially.

Example:

A..
A..
B..
A..
B..

will result in:

A01
A02
B01
A03
B02

The action works on all selected files and ignore those files where the pattern cannot be found in the Title field.

The second action is named Prepend Side and Number to the Title Field. It may be easier to use. It prompts for a side code A-Z (ignoring alphabetic case). It will then number the Title fields of the selected files with the supplied prefix. All files get the same prefix so you have to run it for each side. Again this action will handle existing {letter}## sequences.

Have fun

SnowdogPostJanuary 10, 2023, 15:30
Pro
Posts: 279
Registered:
March 15, 2022, 17:12
Normal topicAdding sequential integers to selected lines

I think I might have to do another little dance.

Thank you! 🙂

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