I have thousands of txt files with a .pdbqt extension in a directory named 100000cpds_ligand_00001.pdbqt
, 100000cpds_ligand_00002.pdbqt
, 100000cpds_ligand_*****.pdbqt
and would like to rename them according to a unique identifier from their contents.
The identifier is given as REMARK Name = PV-000009607404
in a single line, where PV-000009607404
can be of variable length, text, and numbers (e.g. ZINC001248485427
, etc.). I would like to only keep the identifier part in the file name and not the REMARK Name =
part. So, I would e.g. change 100000cpds_ligand_00001.pdbqt
to PV-000009607404.pdbqt
. I can do it from the command line, but lprefarably I would like to use a small script.
Thank you very much for your help!