How can I get a part of text from the .txt file

Hi all,

I have a file where it can have any number of lines in a text file. I need to pull the “Number of Records: 400” from the file, especially “400” count from the file. How can I achieve that?

use regex for extract the number of file


use this expression in matches activity

Hi @Krithi1

Store the vale of the text file in a string variable, and use an assign statement and

You can use this Regex Pattern assign it to an string variable.

System.Text.RegularExpressions.Regex.Match(strInput, “\bNumber of Records:\s+\K\S+”).Value

where strinput is the value from text file.



Hope the following helps you.

System.Text.RegularExpressions.Regex.Match(strText,"(?<=Number of Records:\s*)\d+").Value


1 Like

Thank you all

1 Like

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