Home Download Buy Blog Forum Support

[BUG] Find in Files won't search all files

Re: [BUG] Find in Files won't search all files

Postby karlnordstrom on Wed Nov 21, 2012 7:18 pm

karlnordstrom wrote:
karlnordstrom wrote:I have the same problem. I'm attempting to search for a string in a large file and I would like to see a list of matches. Unfortunately, I always get 0 matches, even though the string is in the file in several places. I can do the regular find and it works.

This is the first thing that I've tried with Sublime and it doesn't work. Otherwise, it looks like a really elegant text editor. :(


I figured out how to show the console, and for some reason it thinks that it is a binary file. It's a text file that is readable in any text reader including Sublime. It doesn't help to change the extension to .txt.


I would attach the file in question, but it is from work and it's not the kind of thing I can post on the internet.
karlnordstrom
 
Posts: 6
Joined: Fri Nov 09, 2012 8:06 pm

Re: [BUG] Find in Files won't search all files

Postby agibsonsw on Wed Nov 21, 2012 7:29 pm

Check the following in your default or user settings:

Code: Select all
    "folder_exclude_patterns": [".svn", ".git", ".hg", "CVS"],
    "file_exclude_patterns": ["*.pyc", "*.pyo", "*.exe", "*.dll", "*.obj","*.o", "*.a", "*.lib", "*.so", "*.dylib", "*.ncb", "*.sdf", "*.suo", "*.pdb", "*.idb", ".DS_Store", "*.class", "*.psd", "*.db"],
    // These files will still show up in the side bar, but won't be included in
    // Goto Anything or Find in Files
    "binary_file_patterns": ["*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip"],
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Re: [BUG] Find in Files won't search all files

Postby karlnordstrom on Thu Nov 22, 2012 2:25 am

agibsonsw wrote:Check the following in your default or user settings:

Code: Select all
    "folder_exclude_patterns": [".svn", ".git", ".hg", "CVS"],
    "file_exclude_patterns": ["*.pyc", "*.pyo", "*.exe", "*.dll", "*.obj","*.o", "*.a", "*.lib", "*.so", "*.dylib", "*.ncb", "*.sdf", "*.suo", "*.pdb", "*.idb", ".DS_Store", "*.class", "*.psd", "*.db"],
    // These files will still show up in the side bar, but won't be included in
    // Goto Anything or Find in Files
    "binary_file_patterns": ["*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip"],


Thank you for the suggestion. I tried that already. I also tried changing the file extention to .txt, but it still didn't work. The strange thing is that I can see it fine and search using the regular find. It's only when I try "Find in Files..." that the file is identified as a binary.
karlnordstrom
 
Posts: 6
Joined: Fri Nov 09, 2012 8:06 pm

Re: [BUG] Find in Files won't search all files

Postby karlnordstrom on Fri Nov 23, 2012 12:38 am

Is there a way to increase the debug log level in the console, something that might give a hint as to why it is skipping it as a binary?
karlnordstrom
 
Posts: 6
Joined: Fri Nov 09, 2012 8:06 pm

Re: [BUG] Find in Files won't search all files

Postby karlnordstrom on Fri Nov 23, 2012 6:25 pm

Okay, I found the problem. There were 3 non-printable characters in my very large file. Solution:

1. Search for non-printable characters by using regular expression [^[:print:]]
2. Delete or replace those characters.

Hopefully others can solve this problem more easily now that I have posted it.

I recommend that Sublime provide the option of searching binary files. This could also be helpful for searching for bits of plain text embedded in binaries (which I have also had to do before).
karlnordstrom
 
Posts: 6
Joined: Fri Nov 09, 2012 8:06 pm

Re: [BUG] Find in Files won't search all files

Postby lgellert on Sun Dec 02, 2012 4:42 pm

Find In Files does appear to skip files with special characters (but it does so silently).

I ran into the same problem which I logged in the other sublime support forum here:
http://sublimetext.userecho.com/topic/1 ... haracters/
lgellert
 
Posts: 1
Joined: Sun Dec 02, 2012 4:39 pm

Re: [BUG] Find in Files won't search all files

Postby KratosGemini on Mon Apr 22, 2013 5:23 pm

I just ran into this type of issue with the same Sublime Text 2 version. So far this is the only issue I have run into that is keeping me from switching to Sublime from Notepad++.
KratosGemini
 
Posts: 2
Joined: Mon Apr 22, 2013 5:21 pm

Re: [BUG] Find in Files won't search all files

Postby KratosGemini on Wed Oct 30, 2013 8:32 pm

Sublime Text 3 seems to have alleviated this issue. It shows "binary" files not in the exclude pattern in the find results. It will just say "<binary>" instead of a preview of the text.
KratosGemini
 
Posts: 2
Joined: Mon Apr 22, 2013 5:21 pm

Previous

Return to Technical Support

Who is online

Users browsing this forum: subhaze, Vlad Ghitulescu and 35 guests