Answer the question
In order to leave comments, you need to log in
How to cut lines in a file by criteria?
Hello colleagues. The task is this. I have an input - a .txt file that has lines, each containing entries like 55555,dif and 55555,bat. How do I cut only those lines that contain a dif in the string? Perhaps with cut or something else?
Answer the question
In order to leave comments, you need to log in
sed -i.bak '/dif/d' filename.txt
filename.txt
Lines that contain text will be removed
from the file dif
. The file will be backed up before changes.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question