3
rated 0 times
[
3]
[
0]
/ answers: 1 / hits: 501
/ 2 Years ago, wed, june 1, 2022, 6:03:39
I have a huge text file (10GB) formatted as follow (multimodel PDB file):
Model 1
... (some text)
ENDMDL
Model 2
... (some text)
ENDMDL
Model 3
... (some text)
ENDMDL
...
Model 9999
... (some text)
ENDMDL
End
I know how to extract each model to a separate file:
while read line; do
echo "${line}" >> model_${i}.pdb
[[ ${line[0]} == ENDMDL ]] && ((i++))
done < $pdb
Now, I need to extract the models in a discrete way in steps of N
. The idea is that if N=5
, then extract the model 1, then the model 6, then model 11, etc.
A note: the number after the word Model
, cannot be used as reference as can be duplicated due to standard issue with multimodels PDB files.
More From » command-line