Welcome Guest

Pages: 1
Adding a full stop in an irregular string
SnowdogPostAugust 26, 2022, 21:12
Pro
Posts: 279
Registered:
March 15, 2022, 17:12
Normal topicAdding a full stop in an irregular string

If I wanted to add a full stop after the Roman numerals in the attached shot, bearing in mind that all of the line lengths are different (& that if there were more movements, we'd be encountering characters like X & V which means I can't expect the I to be a consistent marker) how on earth would you go about that?

Image

SnowdogPostAugust 26, 2022, 21:16
Pro
Posts: 279
Registered:
March 15, 2022, 17:12
Normal topicAdding a full stop in an irregular string

When I say X & V, all I mean is that I was able to add the colon because I could "find & replace" space-I with colon-space-I but had there been a fifth movement in any of them, that wouldn't have worked & I can't make that work at all for something that comes after the Roman numerals because of the V.

2MR2PostAugust 26, 2022, 23:45
Avatar photo
Administrator
Posts: 2083
Registered:
August 23, 2012, 19:27
Normal topicAdding a full stop in an irregular string

This one was fun. I assume that the data is in the Title field. If not, you'll have to change the action. I've documented where it has to be changed.

https://2manyrobots.com/actions/Place-a-period-after-roman-numeral.zip

The only assumption is that the roman numeral follows a : {space} sequence

The roman numeral can be in upper or lower case. It is always converted to upper case. The optional sequence of spaces after the colon is converted to a single space.

If there already is a . after the roman numeral, the action will not insert a second .

Have fun

SnowdogPostAugust 27, 2022, 10:16
Pro
Posts: 279
Registered:
March 15, 2022, 17:12
Normal topicAdding a full stop in an irregular string

Another winner, thanks!

And I'm glad you found it fun because I tried reading the "p-word" documentation but right from the very beginning I found it virtually unintelligible.

"Strings"
Okay, I've read that. I don't really get it but I'm gonna hold those thoughts & see if the next bit helps...

"Numbers"
Some Yate statements let you interpret a string as an integer value... *first cracks appear in my skull*

When this is the case the string representation is converted to an integer value by ignoring everything in the string which cannot be interpreted from the start as an integer... *more cracks, like my head is an alien egg that's being heat-rayed by Godzilla*

For example the Increment statement will extract an integer from a field or named variable, will add one to the value and will then convert it back to a string for storage.... *Boom! The contents of my skull are deposited over my keyboard & my body slips from the chair & lands on the living room floor with a soggy thump*

I think maybe I need a programming 101 course, just to get past the very basics. 😆 😆 😆

SnowdogPostAugust 27, 2022, 10:40
Pro
Posts: 279
Registered:
March 15, 2022, 17:12
Normal topicAdding a full stop in an irregular string

As in:

I know what a "string" is, what a "statement" is & what an "integer" is, but without specific examples to illustrate how these things would play out in reality, I have no real concept of what those things mean in a sentence like that or what they would really do.

2MR2PostAugust 28, 2022, 21:42
Avatar photo
Administrator
Posts: 2083
Registered:
August 23, 2012, 19:27
Normal topicAdding a full stop in an irregular string

Everyone has their comfort zones. Photoshop is unintelligible to me.

In Yate almost everything is text. When Yate Increments and sees a text string of "123" it converts the text to an integer with a value of 123; adds 1 and writes the result as a text string of "124".

If the initial text string was "123 Main Street" it would still see it as an integer with a value of 123 and the result would still be "124".

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