Good morning people, I have a file that contains several lines, including the following:
REMARK Evaluations: CoarseFF Proper-dihedrals Coarse Atomic Repulsion Coarse Compaktr Hbond_Strands Hbond_Angle_Dist_var_power_Strands Hbond_AHelixes
Helix_packing_coarse HB_COOPER_coarse RR_contacts_coarse Total Energy
REMARK 914959: 119.706 63.2753 86.7273 26 237.053 28 2218.95 -48976 13.5677 933.999
I need to get the third line shown there, the second where "REMARK" appears. More specifically, the last numerical value of this line, the value "933.999".
I'm doing this:
while(!feof(arquivo))
{
fgets(linha_do_arquivo, 1000, arquivo);
if( (strstr(linha_do_arquivo, "REMARK") == linha_do_arquivo) && (strstr(linha_do_arquivo, "Evaluations:") != linha_do_arquivo+7) )
{
sscanf(linha_do_arquivo, "%*s %*s %*s %*s %*s %*s %s", valor_numérico);
}
}
However, I was wondering if there is anything to get the bottom line, something like "if line start == helix, fgets + 1", or whatever. I think I can do with fgets, but I do not know how. Can anyone help me?
Any other suggestions are also welcome! =)