Page 1 of 1

Line Counts

Posted: 2008-03-11 17:40:49
by mwiseman
Can anyone suggest a way to count lines? Counting "\n" occurrences would do. I'm looking to get this number into a "$variable"

Thanks

\n

Posted: 2008-03-11 20:59:41
by gemboy27
if you do a find all of '\n'

it will highlight all new lines and then in the finder window list all the \n that were found

It seems like an applescript should work to, but I am just learning that...

...and not that fast

Posted: 2008-03-13 08:37:59
by mwiseman
Great suggestion... I can view the count in statistics or capture it to a variable in a macro. Thanks.

Posted: 2008-03-13 12:04:17
by martin
The Find macro command returns the number of occurrences that matched, so it should be as simple as:

Code: Select all

$newlineCount = Find All "\n"