0

I have a ligand folder lig1 containing about 2000 files in .pdbqt format like:

compound_117_uff_e=945.53.pdbqt
compound_11800_uff_e=593.20.pdbqt
compound_11801_uff_e=543.18.pdbqt
compound_11802_uff_e=221.66.pdbqt
compound_11803_uff_e=689.82.pdbqt
compound_11804_uff_e=397.25.pdbqt
compound_11805_uff_e=482.14.pdbqt
compound_11806_uff_e=485.90.pdbqt
compound_11807_uff_e=437.60.pdbqt

I have used the vimdiff command:

$ vimdiff lig1 d1.csv  

This shows some matching files between lig1 and d1.csv like:

compound_11800_uff_e=593.20.pdbqt
compound_11801_uff_e=543.18.pdbqt
compound_11805_uff_e=482.14.pdbqt

We can use "delete" key of the computer to delete one by one files in lig1 folder. How to delete all the non-matched files at once from command line so that lig1 folder contains only matched ones. The actual folder lig1 and file d1.csv can be extracted from: https://github.com/dharmapaudel/ligand-screening

I want to make lig1 folder of the matched file. That is i want to make the lig1 folder that contains only file for example:

compound_11800_uff_e=593.20.pdbqt
compound_11801_uff_e=543.18.pdbqt
compound_11805_uff_e=482.14.pdbqt

and delete all the non-matched file.

  • If it does not need to be with Vim, then some of these answers may be for you [How can I show lines in common (reverse diff)?](https://stackoverflow.com/questions/746458/how-can-i-show-lines-in-common-reverse-diff) – Friedrich Jul 05 '23 at 09:19
  • The problem is that "lig1" be a folder while d1.csv be a file. Your suggestions work for both files. – Dharmaraj Paudel Jul 06 '23 at 16:43

0 Answers0