Output Rows.Count in a text file


I have a data table where i want to count how many rows there are.
Im using DataTable.Rows.Count in “Log Message” and it works.
How can i make a variable that will work so that i can write how many rows there are in a text file?

To clarify: I dont want to write the information in the DataTable, only how many rows there are.

Sorry for the noob question. :slight_smile:


Welcome to forums

IF you have a one line in text file to consider as a row, then

Use Read Text file activity to read the text file and copy the content to a variable

Now TextVariable.Split(Environment.NewLine.ToCharArray).Count

This will split on the Newline and count the number of lines

Hope this may help you


1 Like