how to search or find and replace multiple lines in notepad++ or emeditor

1

1

i want to do this for many lines 100+ so manual way will be hard

Full example file containing:

user1:user1
user2:user2
user3:user3
user4:user4
user5:user5
user6:user6
user7:user7
user8:user8
user9:user9
user10:user10

example Needed result:

user1:user1

user3:user3
user4:user4

user6:user6
user7:user7

user9:user9
user10:user10

so line 2 and line 5 and line 7 is removed and this what i want because when i try it in notepad++ it won't found because they are in different lines

but i want to find or search for all lines together specially for big file like 1000+ lines

DeathRival

Posted 2017-08-04T18:07:30.180

Reputation: 113

Question was closed 2017-08-05T12:53:13.130

Answers

0

You can use the Find and Replace Dialog with Search Mode set to Extended. To detect a new line, type\r\n as in this example:

Find: user1:user1\r\nuser2:user2\r\nuser3:user3\r\nuser4:user4\r\nuser5:user5 Replace with: \r\n\r\n\r\n\r\n\r\n

This will replace the text: user1:user1 user2:user2 user3:user3 user4:user4 user5:user5

with five blank lines.

If you need to be able to search for unspecified usernames, you will need to use RegEx for that. That is another Search Mode in Notepad++'s options. This may help with that (I do not know how to use RegEx): Using wildcard search/replace in Notepad++

TJ Couch

Posted 2017-08-04T18:07:30.180

Reputation: 11

but i need to do this for many lines 100 or more

how i put \r\ to each line i want it replaced its gonna be manual will be more hard – DeathRival – 2017-08-04T19:08:12.637

You can use a find and replace with find \r\n and replace \r\n maybe. That will replace every new line with the characters \r\n. Then you can copy whatever part of that you need, and find and replace that with blank lines! Does that help? – TJ Couch – 2017-08-04T19:34:09.420

thanks for your trying but still not help

what i mean the lines i looking for the can be in not the same lines in the file

and in same time i need to search for more than 100 lines together

and i don't want do it that way u show i just need copy and paste the lines like they are

line1 line50 line30 line20 etc

and find and replace them wherever they are in the text – DeathRival – 2017-08-04T19:42:13.920