Searched string found with Find but not with Find in Files - reasons?

Find, replace, find in files, replace in files, regular expressions

Searched string found with Find but not with Find in Files - reasons?

Postby bellafortuni » Sat Jan 30, 2010 11:41 am

I have just moved up to v15, latest build.
If I do a straight search in an open file for

</i></br></br>
</i></br></br>


it is found. If I search in files (including the same open file), nothing is found. Manual inspection shows 50+ occurrences in multiple files.
Search and replace has the exact same results -- works fine in an open file, no results in multiple files. This was a standard sort of task in v14 and never a worry. Has something changed in this version?
User avatar
bellafortuni
Basic User
Basic User
 
Posts: 10
Joined: Tue Aug 10, 2004 11:00 pm

Re: Searched string found with Find but not with Find in Files - reasons?

Postby Mofi » Sat Jan 30, 2010 1:09 pm

For most searches there is no difference in search behavior between command Find and command Find in Files. Make sure that all options including the Advanced options are set correct for your search. Is the correct directory specified? Is the correct file type specified? What about the standard options for Unicode search, match whole word only, match case and regular expression? Are any advanced Find in Files options enabled?

There are only 2 differences between command Find and command Find in Files.

The command Find is normally executed only on the current file, but can be also executed on all open files one after the one. So UltraEdit knows if the current file is a Unicode file (all types converted to UTF-16 LE for editing) or an ASCII/ANSI file and therefore runs the Find automatically either as Unicode or ASCII/ANSI search. But command Find in Files is mainly designed to run on not opened files. So for files encoded with UTF-16 LE or UTF-16 BE the option Unicode search must be enabled and for all other files standard ASCII/ANSI search must be used. Of course that means that using Find in Files for searching for UTF-8 or ASCII Escaped encoded characters is very difficult, but your search string does not contain any non ASCII character.

The second difference is only important if the search is a multi-line search, i.e. the search string contains line breaks. The command Find knows the type of line terminations for the current file (all opened files), but the Find in Files command is optimized for speed and therefore does not analyze which type of line endings the investigated files use. Find in Files is for a non regular expression search just a byte stream search and not a smart search like command Find which adapts the search string to the current file format and line terminations type. So when you run a multi-line Find in Files or Replace in Files and your files are not DOS files, you better replace the line breaks in your search/replace string(s) by ^n (UNIX) or ^r (MAC) or ^p (DOS) for non regexp or UE regexp searches respectively \n (UNIX), \r (MAC) or \r\n (DOS) for Unix/Perl regexp searches.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4064
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Searched string found with Find but not with Find in Files - reasons?

Postby bellafortuni » Sat Jan 30, 2010 2:34 pm

It was the unix/dos format that was the problem -- ran the perl convert and all is bliss. Thank you
User avatar
bellafortuni
Basic User
Basic User
 
Posts: 10
Joined: Tue Aug 10, 2004 11:00 pm


Return to Find/Replace/Regular Expressions