Answer the question
In order to leave comments, you need to log in
Easiest way to remove all lines that don't start with a given substring from a text file?
I am not strong in programming, but I assume that this is not a difficult task. Perhaps there are some user functions in some text editor that will solve my problems.
Question: can you share an idea how to solve the problem?
Answer the question
In order to leave comments, you need to log in
Open Excel, take your file, paste it into the table (so that each line is on a separate line of the table)
Then, using the “sort and filter” button, set it so that only the lines you need remain.
After that, select them all and copy them to a new file.
Actually that's all
cat file | sed '/regexp/d' > file2
cat file | grep -v -e regexp > file2
apparently I'm not just not strong, but generally not aware. Where can such a string be entered?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question