How do I remove lines of text before this character?
5,688
- Ctrl+H
- Find what:
^.*(?====)
- Replace with:
LEAVE EMPTY
- check Wrap around
- check Regular expression
- UNCHECK
. matches newline
- Replace all
Explanation:
^ # beginning of line
.* # 0 or more any character but newline
(?= # positive lookahead, make sure we have after:
=== # 3 equal sign
) # end lookahead
Result for given example:
[email protected]:948
===
[email protected]:123
Screen capture (before):
Screen capture (after):
Related videos on Youtube
Author by
chalbrak
Updated on September 18, 2022Comments
-
chalbrak over 1 year
Let's say I have this little text file, for example reasons.
[email protected]:948 [email protected]:11111=== [email protected]:123
How would I remove all the text before
===
?I use Windows 10 so no need for anything about Linux.
-
Seth over 4 yearsSelect them and press either Backspace or Delete.
-
JW0914 over 4 yearsA general FYI that's off-topic, but wanted to share from my own experience: You may want to look at VS Code in lieu of Notepad++ for a variety of reasons, but mainly due to Notepad++ having almost non-existent community development, lack of themes and true dark theme support, a myriad of untrusted plugins, etc.
-
Anaksunaman over 4 yearsVS Code is arguably overkill for general text editing, especially since it can be extremely resource intensive for what should be simple, low-cost operations like text replacement/removal.
-
-
chalbrak over 4 yearsi have a newer version of np++, how do i change the direction?
-
lakshman over 4 yearswhat is the version you are using?
-
chalbrak over 4 years7.7.1, i'm not sure what to do
-
lakshman over 4 yearsIf it has backward direction checkbox, untick it
-
chalbrak over 4 yearsi unchecked backward direction, copy and pasted everything, left replace with empty, put in your code in the find what section, used regular expression and selected the space before the first character and nothing happened
-
chalbrak over 4 yearsthanks, but i also wanted it to be that it removes all of the text before it (including the previous lines eg. thisisanexample)
-
Toto over 4 years@Your question wasn't clear. Change Find what:
\A.*(?====)
and Check. matches newline
. Ths will remove ALL lines from the beginning of the file until===
If this doesn't work as expected, please, edit your question and add sample lines and expected result.