Extract max number from text

I have a column in excel that looks like this:

10
15
19
23 - 25 days
24-26 days
90

I need to get the max number from each cell, so the expected result is:
10
15
19
25
26
90

How can I achieve this?

Thanks!

I kind of figured it out. Not sure if this is the best way though.

Step one:
Check if “Days” exist, if not add additional number to other columns, so it looks like this:

10-10
15-15
19-19
23-25 days
24-26 days
90-90

Step 2: Remove “DAYS”
Step 3: Split by “-” and use the 2nd value.

Is there an easier way to do this?

You can use text functions, e.g.:

asnumber(keepchars(keepafter([Column], '-'), '0123456789'))

@raskarov
Also you can try to use regex expression
image

regex.morph (3.6 KB)

@ckononenko, this looks great, thanks.

I will be using this in multiple projects. Is there a way to re-use modules, so I maintain one copy or do I have to manually recreate the “Extract Number” module in each project manually?

@raskarov Modules are part of the project file. But it’s possible to import modules from another project via Import Module (Tab Design).
image
Also, copying and pasting modules between projects can be done via the context menu.
image

Another way to reuse modules (projects) is have them as EasyMorph Server tasks. In this case, you can run such task from an EasyMorph project using the “EasyMorph Server command” action. If data needs to be passed to/from a Server task, the actions “Import/Export” dataset can import/export datasets directly from/to EasyMorph Server.