If my assumption is correct about what you are asking for, the way that you want to accomplish this task is to break it down into a simple process. You know that the first line is the header, so you read that line in and assign it as the header. Then you have multiple lines; the last one of which is the footer. Basically, read the file in line by line; when you reach the end of file marker, you know that this is the footer. Everything in between is the paragraph text. Note that there's an implicit assumption here that the last line is the footer, and not a blank line. Something like this might fit your purposes:
void getTextFromFile(std::string filename) {
std::ifstream file(filename);
std::string header;
std::getline(file, header);
std::cout << "Header: " << header << std::endl;
std::string line;
while (std::getline(file, line)) {
if (file.eof()) {
std::cout << "Footer: " << line << std::endl;
break;
}
std::cout << line << std::endl;
}
file.close();
}