Find Matching Regex

Hi,

16.01.2024 7** İ* G* E* M* 86904.47 86747.34 157.13

21.01.2024 4** M* S* K* P* 57621.26 0 57621.26

21.01.2024 5** M* G* T* P* İ* 27618.83 867 27618.83

** > There may be 3 or 4 numbers, for example 780 or 7808.
$*$ > More than one font and word may appear.
I want to get the last digits.

Is there any regex or other way?

157.13
57621.26
27618.83

Hi @Mesut_Can

Try the below regex

System.Text.RegularExpressions.Regex.Matches(Input.toString,"[\d\.?]+$")

Check the below image for better understanding,

Hope it helps!!T

no output, read txt file

It’s working for me.

In the Pattern options of Find Matching Patterns activity check the IgnoreCase, Multiline and compiled.

Now try executing this. I changed the regex check with the new regex.

[\d\.?]+$

image

If not works by changing the above options let me know.

Hope you understand!!

Thank you very much for your answers, but I couldn’t figure it out.

Hello @Mesut_Can

If the above regex will not work try the below one, it is also working,

"(\d+(\.\d+)?\s*)$"

In the Properties of Find Matching Patterns activity keep the Multiline, Compiled and Ignore Case options in the Pattern options.

Check the below image for the output,

Hope it works for sure!!

1 Like

Yessss, its work. Thank you very much.

Can I ask one last question?

21.01.2024 4** M* S* K* P* 57621.26 0 57621.26

2(2).01.2024 4** M* S* K* P* 57621.26 0 (-)57621.26

In other words, in the line below, it is just the date and the last digit minus the same. How can I delete two records like this with replace?

Hi @Mesut_Can

Can you be more specific?

Regards

There are two records in the file. In the second one, the date changes and only the last digit is preceded by a minus sign. I want to delete these two statements.

21.01.2024 57621.26
22.01.2024 -57621.26

Hi @Mesut_Can

Can you provide sample text file.

Regards

For example, I have 4 records as below.

In the last two records, the date and last digit are minus compared to the previous record. These records are of no use to me. I want it deleted. The two records shown in the other image should remain.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.