Simplified Multi-Line Replace [Replace/Remove Multiple unique Lines from Hosts File]

Tool for Search and Replace across multiple files.
Post Reply
usaer101
Posts: 6
Joined: Sun Sep 16, 2018 4:11 am

Simplified Multi-Line Replace [Replace/Remove Multiple unique Lines from Hosts File]

Post by usaer101 »

I have a hosts file that is over run with too many entries most of which I don’t want and some which I do. I have another hosts files containing only those hosts I don’t want, in the exact same format. How can I take the list of hosts I don’t want, and multi-line remove/replace them with nothing in my original hosts file?

I have tried all the major software out there, but all of them use the multi line as one contiguous line, instead of each independent line as an independent entry. Or line by line search.

I have 17 thousand unique lines I want to remove from the text, and maybe 150 I want to keep. A SIMPLE option selection box to treat each new line in the multi-line find dialogue as an individual search/replace would fit the bill and save users massive headaches the world around... without having to add any extra expressions or anything.

Is there any way to do this?
usaer101
Posts: 6
Joined: Sun Sep 16, 2018 4:11 am

Re: Simplified Multi-Line Replace [Replace/Remove Multiple unique Lines from Hosts File]

Post by usaer101 »

see I can search for one line, and replace that no problem. but i can't just as easily insert a multi-line of the entire hosts lists and replace it. should be simple imo.
usaer101
Posts: 6
Joined: Sun Sep 16, 2018 4:11 am

Re: Simplified Multi-Line Replace [Replace/Remove Multiple unique Lines from Hosts File]

Post by usaer101 »

I found an answer here, which should work with any text program with regex support, and added a feature req for notepad++ to github to automate this process:

https://notepad-plus-plus.org/community ... ostsfile/4
https://github.com/notepad-plus-plus/no ... ssues/4856
User avatar
DigitalVolcano
Site Admin
Posts: 1715
Joined: Thu Jun 09, 2011 10:04 am

Re: Simplified Multi-Line Replace [Replace/Remove Multiple unique Lines from Hosts File]

Post by DigitalVolcano »

Have you tried the batch processor function in TextCrawler? You can import lists of find/replace pairs into it from a text file.
https://www.digitalvolcano.co.uk/textcr ... =&sct=MjM4
geller6980
Posts: 3
Joined: Tue Jun 22, 2021 6:34 pm

Re: Simplified Multi-Line Replace [Replace/Remove Multiple unique Lines from Hosts File]

Post by geller6980 »

When i import the text file, i get the fields improperly mapped

In the library, i select multiple fields (that all look correct)

When i hit "batch all selected" they come into the batch commands window incorrectly mapped
User avatar
DigitalVolcano
Site Admin
Posts: 1715
Joined: Thu Jun 09, 2011 10:04 am

Re: Simplified Multi-Line Replace [Replace/Remove Multiple unique Lines from Hosts File]

Post by DigitalVolcano »

Have you tried directly importing using the batch window import tool rather than the library one?
geller6980
Posts: 3
Joined: Tue Jun 22, 2021 6:34 pm

Re: Simplified Multi-Line Replace [Replace/Remove Multiple unique Lines from Hosts File]

Post by geller6980 »

yes, and that worked!

Thank you!!
Post Reply