Do you need to do this more than once?
What is the base folder you need it done on? For example, are all the .NEF files you're looking for located under your home folder, or are they in various other places around your disk?
If you need this done once, and your home folder is the base folder, then copy and paste the following into a Terminal window. It must be entered exactly as posted; accuracy is important.
Code:
find ~ -type f -iname "*.nef" \
-exec bash -c 'd=$(dirname "{}"); basename "$d"' \; \
| uniq >~/nefs.txt
The output will be collected in the file "nefs.txt" located in your home folder. You can open it in TextEdit after the Terminal command completes (the shell will reprompt).
There are probably several other ways of doing this.
If you need this done more than once, or done on a different base folder, then the above command can be revised and then put into an Automator workflow. You can then drop folders onto it, it will search them, and put the output in a designated file.