Author Direct  Forum Index Author Direct
Support forums for Author Direct Shareware
 
 FAQFAQ   SearchSearch  RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Count the records/lines in a file script

 
Post new topic   Reply to topic    Author Direct Forum Index -> Schedule Wizard
View previous topic :: View next topic  
Author Message
Tim Bienzen
New user


Joined: 24 Mar 2010
Posts: 2
Location: M&I Bank

PostPosted: Wed Mar 24, 2010 7:06 am    Post subject: Count the records/lines in a file script Reply with quote

I am trying to come up with a script that will count the number of records / lines in a file and save this to a script value. Is this possible? Do you have an example to follow?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Vince Sorensen
Site Admin


Joined: 07 Feb 2005
Posts: 528

PostPosted: Sat Mar 27, 2010 11:18 pm    Post subject: Reply with quote

There is a LOOP through files action, and within that you could SET value to value + 1.
Back to top
View user's profile Send private message
Tim Bienzen
New user


Joined: 24 Mar 2010
Posts: 2
Location: M&I Bank

PostPosted: Wed Mar 31, 2010 7:39 am    Post subject: Stopping InFile Loop Reply with quote

How can I stop the Loop InFile if the variable [COUNTLINES] is greater than 2. Currently it runs until it has scanned all lines of the file. I would like to build if logic in based on the # of line in the file without it having to scan all lines in "C:\123.txt".

SET COUNTLINES 0
LOOP InFile "C:\123.txt"
ADD COUNTLINES
ENDLOOP
IF COUNTLINES < 2
Scipt "A"
END
IF COUNTLINES = 2
Scipt "B"
END
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Vince Sorensen
Site Admin


Joined: 07 Feb 2005
Posts: 528

PostPosted: Fri Jun 25, 2010 3:20 pm    Post subject: Reply with quote

There is an "Exit Loop" script action.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Author Direct Forum Index -> Schedule Wizard All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group