Delete the first n entries from a KM string array Macro

I'm sure others have already figured this out, but I didn't find an easy answer when I tried to do this yesterday. Here is an easy way to remove an arbitrary number of entries from the beginning of a KM string array. This macro is meant as an example for you to incorporate into larger projects.

Hope it saves someone a bit of time!

Delete the first n entries from a KM string array.kmmacros (3.9 KB)

It would be nice if you showed a picture (or whatever) of the final result.

Good idea!

The Search and Replace action will take an input, which in this case is hard-coded to one-two-three-four-five-six-seven-eight-nine. In reality, you would probably pass something dynamically (variable, dictionary entry, etc.)

Here is what happens based on the options you choose from the list input in this example:

n = 1
one-two-three-four-five-six-seven-eight-nineone-two-three-four-five-six-seven-eight-nine

n=2
one-two-three-four-five-six-seven-eight-ninetwo-three-four-five-six-seven-eight-nine

n=3
one-two-three-four-five-six-seven-eight-ninethree-four-five-six-seven-eight-nine

And so on...

This example is, technically speaking, removing the first n - 1 entries, but you can customize the %Calculate%local_n - 1% part of the Regex to change that behavior.