How to split a random text containing numbers and print the last 9 digits

Hi all,
I have a random text of numbers I want to print the last 9 digits of the last line in that text. Please do help me.

I have tried using to split(enviroment.newLine) and tried to print the last line but it did not help.

bhavya.txt (1017 Bytes)

Thanks in advance
:slight_smile:

Hi!

You were quite close, take a look at this:

Right(strTextFile.TrimEnd.Split(CChar(vbNewLine))(strTextFile.TrimEnd.Split(CChar(vbNewLine)).Length -1),9)

It is easy.

  1. Take it in variable for ex Var testString
  2. testString=testString.trim
  3. testString.Substring(testString.Count-9).ToString

That’s all

2 Likes

Hi @Bhavya_Amala_Kosana

Please refer the xaml below.

data1.xaml (13.2 KB)

Hope this helps you!

Thanks

I recommend this topic :wink:

Thank you. It helped me out :slight_smile:

1 Like

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