Text editor to copy n lines after occurence of search pattern

  • Does anyone know of a text editor to copy n lines after occurence of search pattern?

    I have a huge file with over a thousand deadlock graphs.

    I want to snag say the first threee lines after the occurence of the string "Wait for graph" . Is there a text editor out there that allows me do so?

  • I'm no RegEx expert but it seems like something that most editor's RegEx search should be able to do.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • raw text or RTF? editplus can do that easily to raw text,you just set a macro to search for a term to find the start, then make it select while searching for a end of line three times; you can make it rreleat the same action an unlimited number of timesw...it auto prompts you to continue every 10,000 repetitions of your macro.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Thanks for your reply

    rbarryyoung - What I want to do is toi snag the first few lines of each deadlock graph to see if there's a common pattern among the 1000 or so deadlocks. Textpad etc. will allow me to sanp just the first line but not the subsequent ones

    Lowell - I shall try out your rreccomendation for Editplus

    I figured out that it would involve writing some sort of a macro - no matter what the text editor

  • Rohit Nayak (5/10/2009)


    Thanks for your reply

    rbarryyoung - What I want to do is toi snag the first few lines of each deadlock graph to see if there's a common pattern among the 1000 or so deadlocks. Textpad etc. will allow me to sanp just the first line but not the subsequent ones

    Lowell - I shall try out your rreccomendation for Editplus

    I figured out that it would involve writing some sort of a macro - no matter what the text editor

    Their RegEx won't span lines? That's odd.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • UltraEdit

    http://www.ultraedit.com/

    -MarkO

    "You do not really understand something until you can explain it to your grandmother" - Albert Einstein

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply