D
D
dariay2018-07-29 01:41:46
Text Processing Automation
dariay, 2018-07-29 01:41:46

How to clear a text file from lines that do not contain certain characters?

Hello. In the file, each line must contain "yandex" or "google". If it doesn't, then delete the line. How to do this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xmoonlight, 2018-07-29
@dariay

notepad++
How to delete lines through bookmarks
1. Menu -> Search -> Marks -> [enter what we are looking for] -> Bookmark (check the box) -> Mark all
2. Menu -> Search -> Bookmarks -> Delete all lines No bookmark
PS: [enter what we are looking for] - you can enable regex expressions and enter:yandex|google

R
Roman Mirilaczvili, 2018-07-29
@2ord

Bash/Cygwin:
grep -E -v "(yandex|google)" < in.txt > out.txt

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question