halcyon627

Count number of lines in text file

4 posts in this topic

I am wanting to be able to count the number of lines in a text file and put that amount into a variable. It seems so simple, but I can't figure it out. Is there an easy way to do this?

Share this post


Link to post
Share on other sites

Try this:

Variable Set Integer %N1% to 0
Text File Begin Process: "FileIn.txt"
  Variable Modify Integer: Inc (%N1%)
Text File End Process

// Here %N1% contains the number of lines

Copy and paste this code:

<IVAR2:01:01:0><BTFBEG:001:000001:000000:c:\Users\username\Documents\FileIn.txt><NMVAR:08:01:0:0000001:0:0000000><BTFEND><REM2:><REM2:Here %N1% contains the number of lines>

 

Share this post


Link to post
Share on other sites

Okay I can definitely try this!

After I use the script editor, where do I paste the code below? Do I paste that using the direct editor?

I hope this works!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now