is there a quick and easy way to count the number of lines in a file loaded externally?
Use count() and file(), or fgets() and a while loop with a counter.
Diego