How to use Finder to find all files that do not match a certain criteria?
Just typing the operand NOT before the criteria will do the trick.

So, in this case, typing NOT .txt will show all the files but the ones with the .txt extension.