count rows in a text file.

Discuss RoboTask here
Post Reply
johanmartens
Posts: 3
Joined: Fri Jan 15, 2010 12:42 am
Location: Sweden

count rows in a text file.

Post by johanmartens »

Hi
Is there a way to count how many rows there is in a text file?
 
Best regards and thanks.
Oleg
Site Admin
Posts: 3201
Joined: Thu Jan 01, 1970 1:00 am
Contact:

count rows in a text file.

Post by Oleg »

You have to use Text Loop action.
Algorithm is simple:

set variable LineCount to 0
text loop
   inctement variable LineCount by 1
end loop

after the loop you get the number of lines of the text. If you get 0, this means that text is empty.
jonjon
Posts: 17
Joined: Sun Nov 05, 2006 10:14 pm
Location: Sweden

count rows in a text file.

Post by jonjon »

Thanks for answer, it works perfect.
 
 
Post Reply