Piet Souris wrote:hi Spencer,
there are some easy ways. The first is to use a Scanner, like:
Alternatively, you can use a Stream, like:
If you don't want the burden of physically loading those files, you could have some statistics about the average length of a line in a file. From that and the size of a file, you can give an estimate of the number of lines. This is not exact, of course.
Hi is there a way to do this without having to add each txt file individually to the code?
Thanks
Spencer