Search for files by extension

  • I’m hoping this isn’t a dumb question. Is there a way to use Notepad++ to go through a directory and return a list of files by extension? For example, if I have 20k files in a directory with multiple file types, I would like to get a list of files for a specific extension that I can then edit for other purposes. I am not interested in the contents of the files. I know how to do this in unix and also by using dos commands but I was hoping to find a quick way to do this in Notepad++. My apologies if this has already been discussed before. Thank you.

  • @B-Marcin

    not sure what you are looking for exactly, but what about File->Open and in file name put in *.YOUREXTENSION and press enter.


  • Claudia, I don’t need to open any files. I want to be able to search for files within a directory that have a specific extension and then be able to copy the result set into my clipboard. Notepad++ can search through a set of files and return a result set showing the lines where a filter matches but I’m simply looking for a way to retrieve a list of filenames. Thanks.

  • @B-Marcin

    A simplified way of doing this is something like the following in the Run menu’s Run… box:

    cmd /c dir/s/b $(CURRENT_DIRECTORY)\*.txt | clip

    Obviously the example uses files with a .txt extension…

  • Thanks, Scott. I can get the list like you say using DOS commands, however, I was hoping there was a way to do it in Notepad++. I used to work with Ultraedit which performed this sort of function easily but I no longer have a copy of it.

  • @B-Marcin said:

    hoping there was a way to do it in Notepad++

    What wasn’t “in Notepad++” about my suggestion? ;-)

  • Got it. I thought you meant the Windows Run box. Thanks :)

    I still would have figured that this would be a basic one or two-step function in Notepad++ sans all the parameters, etc.

  • @B-Marcin

    Well, if you leave it sitting in the Run menu, it sort of becomes a parameter-less thing… You can return to it easily later and change the extension to search for, for example.

    This is the world of Notepad++, where workarounds thrive for things you will NEVER see made into simple clickable menu items. I, for one, like the aspects of N++ that allow such things to be possible. I tried UltraEdit (and others) for awhile before settling on N++; coming from another powerful editing environment that I used for 20 years, I’ve (so far) found that N++ is one of the few suitable for the needs of the true power user. :-D

  • Scott - Yes, I see that now. Thanks for the help.

Log in to reply