Exit when last row of csv is reached

csv
studio

#1

How to stop reading csv when it has reached the last read row in the csv.


#2

Are you using [Read CSV] activity to read csv and output them in a DataTable?

If so, the activity does take care of all the procedure for you from start to end :sunglasses:


#3

Thank you for your inputs… however, I have a recording sequence for first row and a different recording sequence for all other rows. Currently I controlling the loop with a static variable counter. How can I make csv function exist or count the number of rows to be processed after first row


#4

@avinashgautam
You might just want to use [Read CSV] activity as I mentioned above unless you want to manipulate the CSV file itself while you are looping it.
(Sorry if I’m wrong with your intention or you could be more specific on your requirement.)

Here is the guide on how to read data from a CSV file:

Simplicity is the best and it’s the reason why we use this type of software.


#5

To count the number of rows
Use this urDataTableName.Rows.Count


#6

@avinashgautam you can exist the next iteration just by using if condition where you need check whether your variable has null value .
If variable contain nothing then you could stop reading excel