...

/

Counting Number of Lines in a File

Counting Number of Lines in a File

Let’s take a look at how to find the number of lines in a file.

Counting lines based on a newline character

Previously, we learned how to count words from a file.

In this lesson, we’ll learn how to count the number of lines in a file using the split() method on the newline ...