Jump to content
  • 0

How to search by attachment extension. ie. *.zip, *.bin, *.doc?


gmc

Idea

I commonly have used EN for years to store various file attachments with my notes such as the common .doc or .txt, but I also use others like .bin, .hex, etc.  I used to be able to search for filename:"*.bin" to find the.bin files, for example.  Apparently (according to my notes on this issue) I've also been successful using "(.bin)" in the past .  Now none of these options seems to work for me on Win7, Web, or Android.  Can someone please enlighten me as to what the trick is to perform this action?

Link to comment

7 replies to this idea

Recommended Posts

  • 0
  • Level 5*
12 hours ago, gmc said:

I commonly have used EN for years to store various file attachments with my notes such as the common .doc or .txt, but I also use others like .bin, .hex, etc.  I used to be able to search for filename:"*.bin" to find the.bin files, for example.  Apparently (according to my notes on this issue) I've also been successful using "(.bin)" in the past .  Now none of these options seems to work for me on Win7, Web, or Android.  Can someone please enlighten me as to what the trick is to perform this action?

You can check out this site to see if you can find the MIME type.

https://www.freeformatter.com/mime-types-list.html

Link to comment
  • 0
  • Level 5*

I generally refer to the Evernote Search Grammar page (http://dev.evernote.com/doc/articles/search_grammar.php) for search terms. Usually you'd match resource types (i.e. attachments) using MIME types (https://www.freeformatter.com/mime-types-list.html). I don't know how to match by file extension in general, though. Anyways:

For .zip files, you should be able to use: resource:application/zip

For .doc files, you should be able to use: resource:application/msword

For .bin files, I don't know

 

Link to comment
  • 0

Thanks everyone!  With your advice I think I got the .bin search mostly working by using:

*.bin resource:application/octet-stream

Without the *.bin at the beginning it seems to find other notes with .exe, .ini, and  .jpg's (I guess they look like binary streams).  Those get filtered out by adding the *.bin string.  So I'm guessing the filename:<string> has been deprecated, or maybe it's just another "feature" that quietly disappeared...

  • Like 1
Link to comment
  • 0
  • Level 5*
15 hours ago, gmc said:

Thanks everyone!  With your advice I think I got the .bin search mostly working by using:

*.bin resource:application/octet-stream

Without the *.bin at the beginning it seems to find other notes with .exe, .ini, and  .jpg's (I guess they look like binary streams).  Those get filtered out by adding the *.bin string.

I did see that one, but also saw that it wasn't specific to .bin files, and didn't have time to dig deeper, so put it aside for a bit. I believe you'd get the same results replacing the "*.bin* with just "bin"; I think that the "*." is just ignored. That part is just a normal text search, as far as I can tell, and what the search information reflects... I got hits on .svg and .gz and others; I think that this filter is pretty much a catchall.

15 hours ago, gmc said:

So I'm guessing the filename:<string> has been deprecated, or maybe it's just another "feature" that quietly disappeared...

The "filename:" still exists (it's in the formal search grammar given here: https://dev.evernote.com/doc/articles/search_grammar.php, it's kind of buried and not explained in detail), but I don't think that it works in the way that you might think. Basically, it can be used to identify attachments by filename, but any wildcard  must appear after plain search text, i.e., no prefixed or infixed wildcards are honored. So you can use something like "filename:mypic*" to match match notes with attachments "mypic1.png", "mypicsFromFlorida.pdf", etc, but not to match filenames by extension. In that way, it works like regular text, tag, and title searches, more or less.

It would be nice to have expanded wildcards, indeed, regular expressions supported in the search language, but I gather from what Evernote folks have said that that would be a performance headship for search in general, including in the Evernote servers.

Link to comment
  • 0

Looks like you're correct regarding the * being ignored.

I used to use the filename: to search out by extension so they must have changed it at some point (haven't used it for probably >1yr).  The server load argument (from them not you!) is a little weak; every linux, programming language, and editor, can pretty much do regular expressions and the algorithm(s) have been optimized for decades so they usually lightening fast... I would assume the vast majority of users don't use the web interface so the load would be on their device anyway and not EN servers.

Link to comment
  • 0
  • Level 5*
17 hours ago, gmc said:

The server load argument (from them not you!) is a little weak; every linux, programming language, and editor, can pretty much do regular expressions and the algorithm(s) have been optimized for decades so they usually lightening fast... I would assume the vast majority of users don't use the web interface so the load would be on their device anyway and not EN servers.

Evernote staff have commented on this before. One quote on regular expression search, circa 2010, that I found was from Dave Engberg, the former CTO (I found the quote, but evidently you can't access the actual reply for some reason):

@engberg replied to @theill's topic in Evernote API Discussion

 
Quote

 

We don't support arbitraryregularexpression searching through notes, since this isn't possible to do quickly on large (e.g. 5GB+) accounts. We do word/phrase matching only since this can be optimized via a full-text search engine like Lucene. So you can match against prefix patterns to find notes...

 

Also, this more current reply has further info:

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...