How can I calculate the length of a text?

We have a length property:

Applescript:

set theText to"blah"

theText's length --> 4

For intensive calculations, you may use the command count, which is faster:

Applescript:

count theText --> 4

Some times, you may wish calculate the length of a very long text (eg, 479MB), and you won't hold such amount of text in a variable, but in an external text file. You can choose your favorite and reliable *nix tool, or just: