R
R
realt2016-12-15 17:18:33
cmd/bat
realt, 2016-12-15 17:18:33

How to remove lines containing certain words?

How to remove lines containing certain words?
For example, there is a txt document or an exel file, in which lines from phrases go into a column. You need to delete lines that contain certain words. For example, these words are also available as a list separately or in a file or somewhere else, it doesn’t matter.
I will consider any options for exel, cmd, vbs, somehow! Help me please.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Max, 2016-12-15
@MaxDukov

swing sed - for txt/csv it is VERY fast. a file of a couple of gigs parses in a few minutes.

J
John Smith, 2016-12-15
@ClearAirTurbulence

In excel it is very simple if handles.
make headers A1 "DATA", B1 "FLAG" or to taste.
Let's say the values ​​in column A are from A2 and down.
To the right of the value column, a formula is drawn
if the search should be case-insensitive, FIND if case-sensitive.
On the Data tab, enable autofilters.
We filter the DATA column - rows where the value is TRUE contain the required substring.
After filtering - select everything filtered, then on the HOME tab select FIND & SELECT, Go To Special, in the dialog - Visible Cells Only. This way you select only the visible cells.
Delete the lines selected in this way, remove the filter.
If there is really no point in deleting the data, but it is enough to hide them - just filter the table, but by the FALSE tag, the values ​​with the substring will simply be hidden.
If you automate it, it's a little more difficult, but already for money and for freelancing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question