On second thought, it a bit unclear what you are trying to achieve. Do you want to get only the line that
ends with a particular character/substring?
In this case you could use a combination of
getline() to get a line from a text file,
rfind() to find the last occurence of a character/substring,
and size() (for example) to test if the substring is at the very end of the string.
Code:
getline(FileIn, line);
pos = line.rfind(substring);
if (pos == npos && substring.size()+pos == line.size()
//you got it