Hello liz Lopez,
PLEASE ALWAYS USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
http://www.cplusplus.com/articles/z13hAqkS/
Hint: You can edit your post, highlight your code and press the <> formatting button.
You can use the preview button at the bottom to see how it looks.
Your program is a good start, but as you can see it does not work.
Line 5. It would be best not to use this. It
WILL get you in trouble some day.
Line 9. If it works on an input file, using "ios::app" will open the file with the file pointer at the end. Not what you want.
Checking that the file opened is good.
Line 18. Looping on "eof" will not work the way you think it will. Usually you will process the last read twice before the while condition becomes false.
Line 20. will read the entire line as you should have seen. With the use of the "#" between each field using "std:getline" would work better to read each field into a different variable.
Using the header file "<iomanip>" will help to space out the output the way you want.
I will work up an example for you shortly.
Hope that helps,
Andy