Author Topic: How to find all occurrences of X in an file?  (Read 2663 times)

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 775
  • Karma: +6/-0
How to find all occurrences of X in an file?
« on: July 12, 2010, 12:32:04 PM »
Today i want to show you how you can get an list of lines which all have an "string" you want to preview.

For example i code in VBScript with many functions/subs,
which all have an "On Error Resume Next" statement as second line.

Usually, i comment-out one or more of this "On Error Resume Next" lines to disable error-handling for to find an bug.
Later, i forget to enable all of this again  ::)

With HippoEDIT i simple do an search for "On Error" with the option "Find All" and "Result Output to Window 1"
This gives me an list with all lines containing at least this "On Error" string. (see picture)

Now, in that output window, i can see that i have forgotten two statements to un-comment.
In HippoEDIT i can click on that lines in the "Find Results 1"-output window and HE scroll the document
to that line in question, where i can easily modify that line and remove the comment sign.
Then i simple click on the next line in the output and HE scrolls fast as an greyhound to that line in the document.

This "Find All"-option is also nifty to find, e.g.  all lines containing the string "myFunction",
or e.g. "myVAR"... one of the first lines found should then have an DIM in front of myVAR  :)

Note that you can also use the option "In New Document", e.g. to copy all lines containing "ToDo" to an other document.


« Last Edit: July 12, 2010, 12:35:31 PM by Stefan »
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-