Well if you're only writing this for that file, you could read in until a space and read in until a newline each time through the loop, after a few iterations, you'll end up with BallSpin in the string.
Code:do { getline(fin,test, ' '); getline(fin,test, '\n'); cout<<test<<endl; } while (test != name);