[英]How to copy files which are present in multiple directories within multiple sub folders two levels up?
[英]How to extract names of compound present in sub files?
我有一个包含 15000 个文件夹名称的 15000 个化合物名称(文件名:uniq-compounds)的列表。 该文件夹有子文件,即out.pdbqt
,其中包含第 3 行中的化合物名称。 (名称 = 1-叔丁基-5-氧代-N-[2-(3-吡啶基)乙基]-3-吡咯烷甲酰胺)。 我想通过提供 50,000 个文件夹中的 uniq 复合文件(它包含文件夹名称,例如ligand_*
)来提取所有这 15000 个名称。
sidra---50,000folder (ligand_00001 - ligand50,000)--each contains subfiles (out.pdbqt)--that conatins names.(mention below)
another file (uniq-compound) contains 15000 folder names (that compound names i want).
MODEL 1
REMARK VINA RESULT: -6.0 0.000 0.000
REMARK Name = 1-tert-butyl-5-oxo-N-[2-(3-pyridinyl)ethyl]-3-pyrrolidinecarboxamide
REMARK 8 active torsions:
REMARK status: ('A' for Active; 'I' for Inactive)
REMARK 1 A between atoms: N_1 and C_7
假设, uniq-compound.txt
包含文件夹名称,每个文件夹包含一个out.pdbqt
。 此外,化合物名称出现在文件out.pdbqt
的第三行。 如果是这种情况,下面的脚本将起作用:
#!/bin/bash
while IFS= read -r line; do
awk 'FNR == 3 {print $4}' $line/out.pdbqt
done < uniq-compound.txt
Loop 会一一遍历uniq-compound.txt
,对于文件(即文件夹)中的每一行,它使用awk
显示该文件out.pdbqt
内文件out.pdbqt
的第 3 行的第 4 列。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.