regex - Notepad++: Remove lines containing the word "Correct" and the two lines above it -
i have text-file this:
010 2015.06.29 09:57:57.731 warn always_same_text] no notaris found given strings (used postadres): different_texts 010 2015.06.29 09:57:58.220 warn always_same_text] no tussenpersoon found given strings: different_texts 010 2015.06.29 09:57:59.288 warn always_same_text] more 1 cluster (2) found given string: different_texts 010 2015.06.29 09:58:00.192 warn always_same_text] more 1 cluster (2) found given string: different_texts 010 2015.06.29 09:58:02.766 warn always_same_text] no notaris found given strings (used bezoekadres): different_texts trying retrieve notaris postadres instead of bezoekadres 010 2015.06.29 09:58:02.778 warn always_same_text] correct notaris found when using postadres instead of bezoekadres 010 2015.06.29 09:58:03.647 warn always_same_text] no notaris found given strings (used bezoekadres): different_texts trying retrieve notaris postadres instead of bezoekadres 010 2015.06.29 09:58:03.659 warn always_same_text] correct notaris found when using postadres instead of bezoekadres 010 2015.06.29 09:58:03.991 warn always_same_text] no notaris found given strings (used bezoekadres): different_texts trying retrieve notaris postadres instead of bezoekadres 010 2015.06.29 09:58:04.004 warn always_same_text] no notaris found given strings (used postadres): different_texts
what i'd achieve removing of following lines (containing word "correct"):
correct notaris found when using postadres instead of bezoekadres
including 2 lines above it. in example above, want remove following lines:
010 2015.06.29 09:58:02.766 warn always_same_text] no notaris found given strings (used bezoekadres): different_texts trying retrieve notaris postadres instead of bezoekadres 010 2015.06.29 09:58:02.778 warn always_same_text] correct notaris found when using postadres instead of bezoekadres 010 2015.06.29 09:58:03.647 warn always_same_text] no notaris found given strings (used bezoekadres): different_texts trying retrieve notaris postadres instead of bezoekadres 010 2015.06.29 09:58:03.659 warn always_same_text] correct notaris found when using postadres instead of bezoekadres
- note:
always_same_text
,different_texts
replaced confidentially. stated names,always_same_text
same piece of text, ,different_texts
have different texts per log-line.
i know can use ctrl + f
-> mark-tab
-> bookmark line checkbox
-> mark all
search-term correct
, how can mark 2 lines above lines containing word "correct"
, if possible in notepad++. there many of them mark hand.
actually, i'm asking wrong question, let me try again:
i have .txt
file log-lines in example above , want remove lines containing word correct
, every 2 lines above line. prefer in notepad++, if has easy copy-paste file can run in visual studio
achieve same goal it's fine me.
regex:
.*[\r\n]+.*[\r\n]+.*\bcorrect\b.*[\r\n]*
replacement string:
empty string
Comments
Post a Comment