Page 1 of 1

Needed file content view in Find in Files

Posted: 2012-08-30, 07:58 UTC
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 :)

Posted: 2012-09-01, 21:58 UTC
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)

Posted: 2012-09-02, 06:37 UTC
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 :)

Posted: 2012-09-02, 09:26 UTC
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.

Posted: 2012-09-02, 11:12 UTC
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 :)

Re: Needed file content view in Find in Files

Posted: 2014-07-01, 02:42 UTC
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.

Posted: 2014-07-16, 05:16 UTC
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)

Posted: 2014-07-18, 02:40 UTC
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.