TextEdit Get the count of lines in a file


There is no status bar for the TextEdit application on the Mac to show the word or the line count of a file.

If you want to know the number of lines in a file using TextEdit, you would need to use a hack using the Find option.

  1. Open the file in TextEdit
  2. Now go to Edit -> Find -> Find... (or simply press Command + F)
  3. Now on the search icon (magnifying glass, click on Insert Pattern.
    Select Inspect pattern
  4. Choose line break.
    Select Pattern Line Break
  5. You should see a count of all the line breaks in the file and this is the number of lines (add one to the count) in the file.
How to do a line count in TextEdit

As you can see I get a count of 4, need to add one to get the total count of the lines the file.

-




Have Questions? Post them here!