Extracting more text from a string and correcting a typo

Good morning everyone.
Please, I need to extract from this text string: giorgio, roberto, they are sick but they will get better soon.

Extraction: roberto-sick-they-will-get-well
and put it all on a label with roberto in a capital letter

Can you give me a simple example please.
Don't explain to me how to do it because I wouldn't understand, thanks.

There is no "well" in your text string...

Probably the best thing to do is to split your string to a list, and select individual words by index, and join them (you could use the list separator block for this), and use text manipulation blocks to handle each text.

These blocks do it, but it is very specific...

returns: Roberto-sick-they-will-get-well

1 Like

Great job, TIMAI2.
Thanks, that's a really useful feature.

Sorry again if I bother you please, Remaining unchanged the data to be extracted in a string of any number of words and the position of the data to be extracted was not always the same eg:
string = "1 2 3 4 5 6 7 8 9"
Data to be extracted: "3 5 6 8 "
Or:
string:=" 4 3 5 9 3 1 6 1 8 0 "
Data to be extracted: "3 5 6 8"
How can I extract them?

Use the text contains block to test if an item in your list (3,5,6,8) is in the string, and record it, iterating over your list. If you need to record duplicates, then you need to split the string and iterate over that list for each item in your list.

If you don't give me examples like for the previous blocks, it's impossible for me to follow your instructions.
You must excuse me, unfortunately as I've written several times in the forum, I have trouble understanding what you recommend.
But if this request isn't possible, don't worry, no problem.
You've always been too patient with me. Thank you.

Sorry again I made the examples with numbers to make it easier to understand my need but I made a mistake because in this way I forgot to also include the possibility that the text to be extracted was written in lowercase or vice versa and report it in uppercase:
ex:
String: Mario, giovanni, Giacomo, Alberto, rosy, carlo, Maurizio, salvatore.
Text to extract and correct: giovanni, rosy, Maurizio

String: Mario, rosy, Giacomo, Alberto, carlo, giovanni, salvatore, Luisa, Maurizio, Cecilia
Text to extract and correct: giovanni, rosy, Maurizio

The same approach generally applies.

I may have some time later to demonstrate with blocks, but you should also have a go...

You are right. In fact, I have been trying to solve this problem for five days, also with the help of artificial intelligence. Often, however, the proposed solutions are not correct or, if they are, I cannot evaluate them. Even if they explain things to me in a very simple way, I cannot find the specific errors they refer to or fully understand their indications.
I searched online, but without results. This is why I contacted you.
Take all the time you want. I am doing these experiments to better understand the potential of these blocks and to evaluate whether it could be useful for the development of some apps I have in mind.
Thank you very much.

I made a procedure to convert all names to a first capital letter, the rest is straightforward list handling. What you do with the output is up to you, in this case I simply output to a label.

Note: chatgpt is unlikely to "get" AppInventor :wink:

Very kind thank you. I'll try it and let you know.

Really excellent work TimaI2.
It works perfectly.
Sorry if I go on: I think that many who will read this post, will agree with me to compliment you, because these blocks will give birth to dozens of ideas for new apps.
Hello have a good day and thanks again.

I hope I'm not breaking any forum rules, so I apologize if I do and if you let me know I'll delete everything.

Thanks to your "TimaI2" blocks that (see in .aia) I report the beginning of the project that I had in mind to create as an app, but that I had already created as a working web page, so that in turn I can help others to create it as an app and share with me any developments, so as not to disturb you too much.
Universal Planner.
The idea started from the fact that it didn't seem very logical to me to create a diary with days, months and years, for appointments as in the image, (Monthly Planner.jpg).
I asked myself why not create one that doesn't need all this, but that the user can type any type of appointment, the important thing is that he types inside the text, whatever its length or composition, 4 essential points: Day of the week, day of the month, month, time, so a text like the example:
"Appointment with Giorgio Tuesday 3 December at 10:50".
Or a text like the example:
"Appointment Tuesday with Giorgio at 10:50 on 3 December don't miss it".
The app always and only extracted the important data, however the user edited it, reporting it in a hidden label in the following way: Tuesday 3 December 10:50. (See image 1.jpg)
compared them with, only the same data from the clock and colored the text box that contained them yellow, displaying it in the foreground, even if the appointment was at the end of the list as can be seen in image 2.jpg. and 3.jpg
Not only that, when the appointment is inserted at the bottom of the list, if there are no errors in inserting the important data for comparison into the text, another text box is automatically created, and only if there are no other text boxes, to be able to insert the next appointment.

So when you start the web page or app that you create, only one text box should be displayed, which is gradually added as described, and then after a few seconds, the program should eliminate the boxes with expired or empty appointments.
Of course, you can add a sound alarm or something else that also works in the background.
In fact, that's how it was, I created a really "useful" agenda, I hope.
I hope to replicate it with App Inventor, even if I encounter some difficulties, dictated by the fact that the TIMAI2 code needs further changes, which I am not able to add for the moment, and I did not want to disturb it again.
So I leave it to those who are interested in making an app of this type and if they complete it, post me the .aia in exchange, of course if they want.

I hope I explained myself well.
if you need further clarifications ask them.





Estract.aia (4.1 KB)

I add that if any of you will be able to monetize it, in addition to the best wishes for generous earnings, remember me.