O
O
Oleg2019-01-27 05:09:04
Regular Expressions
Oleg, 2019-01-27 05:09:04

How to remove all lines with text except lines with text;text?

Hello. There is a text file.
The file contains the necessary lines text; text
After them there are unnecessary lines that need to be removed.
How to remove all extra lines except those in which the words are separated by a semicolon?
Here is an example file:
text;text
Unnecessary text, numbers
Unnecessary text, numbers
Unnecessary text, numbers
text;text
Unnecessary text, numbers
Unnecessary
text, numbers
Text;text
Unnecessary text, numbers
Unnecessary text, numbers
Unnecessary text, numbers

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question