It depends on the format of the file as to how simple or complex the code will be. At the most basic, a file containing 7.0501 (had to make it different a littel) you would do something like so:
You can basically make the file however you want, just remember that as the programmer it falls on you to code it so the program can read it without any problem.
My code has that error because it originally looked like ne555's recommendation of while(inFile >> Freq) and didn't have an eof() check. It was a last minute change that came about from viewing beginner forums on other sites where beginners were confused by while(cin >> var). After some debating I opted to move it, but forgot to add an eof() check. Wanted to avoid the risk of confusion, which led me to delete another example I wrote due to thinking it may have been too much for what this topic had asked.