0

I want to find the 2892216th match using a regular expression in vim (technically any linux tool that could give the context to the 2892216th match would suffice)

Ransom Briggs
  • 3,025
  • 3
  • 32
  • 46
  • 3
    [This](http://stackoverflow.com/questions/15135430/display-only-the-nth-match-of-grep) answer has some nice ways to do it with `awk`. Since your file is so large it may be more efficient than using vim. – GWW Jun 19 '13 at 16:37

1 Answers1

4

You can say 2892216/regex in vim. Make sure that you are at the beginning of file or the count will be wrong. It is nth match from the current position.

unxnut
  • 8,509
  • 3
  • 27
  • 41