Sublime Forum

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

#1

My project includes several file types. When I ask sublime to search all files for a plain old string, given the following list of patterns in the Where box–

.inp,.h,.hin,.hpp,.c,.cin,*.cpp

–it will find the string anywhere except in a *.inp file. It doesn’t matter whether *.inp appears at the beginning or end of the list. The file exists in my directory and it’s in my project’s file_include_pattern, so it appears in the Project side bar and I can open it and search to verify that the string I’m looking for is actually in the file. But nothing I’ve tried will make it show up when I use Find in Files.

0 Likes

#2

Any suggested fixes for this?

0 Likes

#3

same thins :frowning:
search in file ignore .asm files
even if i add ,*.asm in ‘Where’ field

anyone can help ?

p.s. 2.0.1 2217

0 Likes

#4

Find result show correct count of files
"Searching 36 files for “L585E” "
but not found anything :frowning:


looks like i found trouble

my files contains some symbols
when file opened in sublime - they looks like inverse and (or like up/down arrow in text mode)
when i remove this chars - search works …

0 Likes

#5

Interesting. I wonder if Sublime is mis-identifying files that contain even a single non-ASCII character. I bet that a funny character inside a string literal makes Sublime think the file is binary, and it skips the file – despite the fact that you include it in the search patterns.

Does the developer read this board?

0 Likes

#6

is it you problem with inp files ?

Does the developer read this board?
looks like not …

0 Likes

#7

Yes, I believe this is the source of my problem. The .inp file has a funky character inside a quoted string literal.

0 Likes

#8

It sure would be nice to have an acknowledgment of this issue and to know it will be fixed.

0 Likes

#9

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. :frowning:

0 Likes

#10

[quote=“karlnordstrom”]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. :frowning:[/quote]

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.

0 Likes

#11

[quote=“karlnordstrom”]

[quote=“karlnordstrom”]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. :frowning:[/quote]

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.[/quote]

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.

0 Likes

#12

Check the following in your default or user settings:

"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"],

0 Likes

#13

[quote=“agibsonsw”]Check the following in your default or user settings:

"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"],[/quote]

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.

0 Likes

#14

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?

0 Likes

#15

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).

0 Likes

#16

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:
sublimetext.userecho.com/topic/1 … haracters/

0 Likes

#17

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++.

0 Likes

#18

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 “” instead of a preview of the text.

0 Likes