This code won't open, and I don't know whats wrong with it.
Please try to be more explicit about the problem than "code won't open". Does it compile? Does it run and crash? Does it run and produce incorrect output?
Also, PLEASE USE CODE TAGS.
#include < string>
should be (with no space): #include <string>
After that, it compiles.
What it does after that - who knows: you haven't told us and we haven't got the input file.
If it says "Error opening file" then you haven't got the input file either (at least, not in a place where your program can find it).
minsum and secsum haven't been initialised.
You have an unholy mix of >> and getline() for input which is also going to cause you a headache.