Forum Discussion

abjoe's avatar
abjoe
New Contributor II
8 years ago

File Poller: Get files without extension

Hi All,

I am using a file poller snap. In the file filter, what should I give so that I get files with no extensions?

So if I use *.txt I get text files. Similarly, to get files without any extension, what should I give? The folder that I am searching will be having many files with extensions. I just want the files without any extensions.

Thanks in Advance!

4 Replies

  • Just use * (asterisk) in file filter, it will give you all the file extensions from the directory.

    • abjoe's avatar
      abjoe
      New Contributor II

      Hi… I don’t want all the files… I want only the files which do not have any extensions… Many of the files in that folder do not have any extension. I just want those files.

      • tstack's avatar
        tstack
        Former Employee

        Not sure it’s really possible with just the FilePoller, you might want to put a Filter snap right after the poller and set it filter out documents where the file name contains a dot.

  • del's avatar
    del
    Contributor III

    @abjoe, Just for practice, I played around with Directory Browser filter (which uses GLOB patterns like the File Poller Filter) and came up with a filter that works partially in my tests… I don’t know how reliable it will be for you, so tstack’s suggest is likely a better option.

    *[!.]???

    The two issues I found with this filter are

    • it requires all extensions to be exactly 3 characters (i.e. works with .txt but not .json)
    • it will not pull in non-extension filenames with a filename less than 4 characters long