You can expand the /pattern1/,/pattern2/ condition as much as you want, by adding a {} block after to be performed when this occurs:

See for example how we print those numbers being between 50 and 70, but just the first 5 matches of each block:

$ seq 200 | awk '/50/,/70/ {if ($0~/50/) {c=0}; if (c++ &lt;= 5) print}'
50
51
52
53
54
55
150
151
152
153
154
155


In your case, you may want to say something like this, that will print the first 10 lines that were matched.

awk '/[^&lt;]select[^&gt;]/,/from/ {if (c++ &lt;= 10) print}' *


A more complex solution would consist in storing all this output and then printing it at the END block. This way, you can control the block itself instead of just a specific line. I would do this storing the data in an array, etc.

Is there a way to limit the range of the range pattern in awk?
Result property meaning:


  Specifies the value that is returned to window in response to handling
  the message


But MSDN does not says anymore:
http://msdn.microsoft.com/en-us/library/system.windows.forms.message.result%28v=vs.110%29.aspx

I will remark this quote words from the user @Idle_Mind in this question Trying to write a better WndProc Handling:


  You can set the Result() property to change the way the message is
  handled.


It is just like a winapi function return success value? Zero = true and non-zero = false, or what is?

Someone could explain me really what means the value of that propertie, in which circunstances I should need to use this value, and show me a code example of how I can use it handling messages from a wndproc sub?


  UPDATE:


Example of how I'm trying to handle WM_CREATE message...

Protected Overrides Sub WndProc(ByRef m As Message)

    Select Case m.Msg

        Case &amp;H1 ' WM_CREATE
             m.Result = -1

    End Select

    MyBase.WndProc(m)

End Sub

