Follow us on:    Twitter  |  Mastodon  |  Facebook  |  WhatsApp  |  Telegram  |  Google News

Visual Studio has a nice feature to calculate the Lines of Code (LOC) in source files. But do you know that you can also use Notepad++ to find the Lines of Code (LOC) in your source files in a directory? Here we will show you how to do it.

 

How to count LOC with Notepad++

 

To find the LOC of your source files using Notepad++, you can follow the steps mentioned below:

  1. Open your Notepad++ instance.
  2. Press CTRL + SHIFT + F to open the "Find in Files" dialog.
  3. In the "Find what" input box, enter "\S+\s*$" as the regular expression to find out the lines containing some text.
  4. Select the "Directory" for which you want to search.
  5. Under the "Search Mode" section, select the "Regular expression" checkbox.
  6. Finally, click on the "Find All" button to start the search.
  7. Once the search completes, check the search result in the "Find result" panel to get the total LOC.

How to count LOC with Notepad++