0

I have a long text file as follows (generated from download links and downloaded filenames):

file01 48976 5873987 48976 48976 thdshiesde
file02 29876 589845637 29876 29876 uyjedrty 54
file03 38745 58934 99432 38745 hytug 48

etc.

I want to delete the lines that have fields 2, 4 and 5 duplicated.

From the above example I want to produce:

file03 38745 58934 99432 38745 hytug 48

etc.

(The first two lines contain the necessary duplicate fields required for deletion while the third line does not so it is kept.)

Any suggestions?

5

AWK does this trivially:

awk '!($2 == $4 && $4 == $5)'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.