Needed file content view in Find in Files

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
erezsh
Junior Member
Junior Member
Posts: 4
Joined: 2012-07-29, 15:34 UTC

Needed file content view in Find in Files

Post by *erezsh »

Hi,

I would like to raise the need for a small feature that would make the built-in Find tool much more powerful.
The problem is that TC's excellent Find tool, with its great support for plugins, returns only file names. When searching for a text within files, however, it's often more useful to give the result as matching lines within the files. See the simple-yet-effective Find in Files tool in Visual Studio as an example.
For me, and many of the people I work with, viewing all the lines that match the search criteria is far more useful than viewing all the files that have such lines.

Excuse me and enlighten me if such a feature already exists somehow :)
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3896
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

Well, at search result list just press F3 button on an entry.
This will open lister with matching text highlighted :)
(press F3 once again to see next match)
#5767 Personal license
erezsh
Junior Member
Junior Member
Posts: 4
Joined: 2012-07-29, 15:34 UTC

Post by *erezsh »

That's what I currently do if I use TC, but still when I need to find all the occurrences of something in many files (e.g. search source code to find all the places a certain method is used) I can't really use TC. There's nothing like getting a single glance of all the lines the method is used without needing to open each file. I know so many people who work this way, and it would be so great if we could use TC for that :)
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Feed results to listbox, select all and press F3 (or Shift+F3 - check Configuration/Edit/View options page to see how to open lister for selected files and not the only focused), lister will open current file and will allow to switch between the files on N and P keys.
erezsh
Junior Member
Junior Member
Posts: 4
Joined: 2012-07-29, 15:34 UTC

Post by *erezsh »

Thanks, it's always fun to discover new TC features like this one!
However this still doesn't answer our need of getting a glance at all the uses of a certain string in many files. When I do this in Visual Studio's search tool I can see all the results (the lines that contain my search string) at once and often find what I'm looking for instantly, without going over all the files...

I'm not saying TC's search tool is bad or that it doesn't offer any workaround for my need, but it certainly doesn't match up against other file search tools. And that's a pity because I use TC for pretty much everything else :)
frantzm
Junior Member
Junior Member
Posts: 2
Joined: 2014-07-01, 02:37 UTC

Re: Needed file content view in Find in Files

Post by *frantzm »

erezsh wrote:When searching for a text within files, however, it's often more useful to give the result as matching lines within the files. See the simple-yet-effective Find in Files tool in Visual Studio as an example.
+1

I would also like to see matching lines without having to open the files.
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

EmEditor has a find in all files, find in all open files, and normal find.
Very useful stuff. Even can output the results to it's output bar (at the bottom).
Example search for "FOO" in all sub-folders within "Documents/Autohotkey" of type *.ahk
C:\Users\B\Documents\AutoHotkey\TestCODE\commaTest.ahk(121): MsgBox, % {}foo
C:\Users\B\Documents\AutoHotkey\TestCODE\commaTest.ahk(164): MsgBox, % JoinPath(0, "bar", "foo")
C:\Users\B\Documents\AutoHotkey\TestCODE\commaTest.ahk(165): MsgBox, % JoinPath(1, "foo", "foo")
C:\Users\B\Documents\AutoHotkey\TestCODE\commaTest.ahk(189): e("foo", "bar")
C:\Users\B\Documents\AutoHotkey\TestCODE\commaTest.ahk(201): msgBox % g().("\/").("FOO").("\/").("BAR").([0,1,2,3]*)
C:\Users\B\Documents\AutoHotkey\TestCODE\commaTest.ahk(212): foo:=111
C:\Users\B\Documents\AutoHotkey\TestCODE\commaTest.ahk(214): bar:=!(WinActive("A") == foo) ? "A != aID" : "=="
C:\Users\B\Documents\AutoHotkey\TestCODE\commaTest.ahk(221): ;if n foo(1)
C:\Users\B\Documents\AutoHotkey\TestCODE\commaTest.ahk(230): foo:=1
C:\Users\B\Documents\AutoHotkey\TestCODE\commaTest.ahk(233): foo(1),bar(2)
C:\Users\B\Documents\AutoHotkey\TestCODE\commaTest.ahk(235): foo(0), bar(0)
C:\Users\B\Documents\AutoHotkey\TestCODE\commaTest.ahk(238): foo(n) {
C:\Users\B\Documents\AutoHotkey\TestCODE\LIB\GVarSet.ahk(1): MsgBox, % "G: " . GVarSet("foo", 1)
C:\Users\B\Documents\AutoHotkey\TestCODE\LIB\GVarSet.ahk(2): MsgBox, % "G: " . GVarQuery("foo")
Example Search of regular expression, (FOO.*BAR|BAR.*FOO)
"(FOO.*BAR|BAR.*FOO)" C:\Users\B\Documents\AutoHotkey\*.ahk

C:\Users\B\Documents\AutoHotkey\TestCODE\commaTest.ahk(111): foo:=2, bar:=3
C:\Users\B\Documents\AutoHotkey\TestCODE\commaTest.ahk(112): bar*=foo
C:\Users\B\Documents\AutoHotkey\TestCODE\commaTest.ahk(119): TestF(foo, [(bar)])
C:\Users\B\Documents\AutoHotkey\TestCODE\commaTest.ahk(120): MsgBox, % (foo) ", " (bar)
C:\Users\B\Documents\AutoHotkey\TestCODE\commaTest.ahk(164): MsgBox, % JoinPath(0, "bar", "foo")
C:\Users\B\Documents\AutoHotkey\TestCODE\commaTest.ahk(189): e("foo", "bar")
C:\Users\B\Documents\AutoHotkey\TestCODE\commaTest.ahk(201): msgBox % g().("\/").("FOO").("\/").("BAR").([0,1,2,3]*)
C:\Users\B\Documents\AutoHotkey\TestCODE\commaTest.ahk(214): bar:=!(WinActive("A") == foo) ? "A != aID" : "=="
C:\Users\B\Documents\AutoHotkey\TestCODE\commaTest.ahk(233): foo(1),bar(2)
C:\Users\B\Documents\AutoHotkey\TestCODE\commaTest.ahk(235): foo(0), bar(0)
frantzm
Junior Member
Junior Member
Posts: 2
Joined: 2014-07-01, 02:37 UTC

Post by *frantzm »

Balderstrom wrote:EmEditor has a find in all files, find in all open files, and normal find.
So can Textpad but we're talking about Total Commander.
Post Reply