| View previous topic :: View next topic |
| Author |
Message |
Tim Bienzen New user
Joined: 24 Mar 2010 Posts: 2 Location: M&I Bank
|
Posted: Wed Mar 24, 2010 7:06 am Post subject: Count the records/lines in a file script |
|
|
| 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 |
|
 |
Vince Sorensen Site Admin
Joined: 07 Feb 2005 Posts: 528
|
Posted: Sat Mar 27, 2010 11:18 pm Post subject: |
|
|
| There is a LOOP through files action, and within that you could SET value to value + 1. |
|
| Back to top |
|
 |
Tim Bienzen New user
Joined: 24 Mar 2010 Posts: 2 Location: M&I Bank
|
Posted: Wed Mar 31, 2010 7:39 am Post subject: Stopping InFile Loop |
|
|
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 |
|
 |
Vince Sorensen Site Admin
Joined: 07 Feb 2005 Posts: 528
|
Posted: Fri Jun 25, 2010 3:20 pm Post subject: |
|
|
| There is an "Exit Loop" script action. |
|
| Back to top |
|
 |
|