I am trying to write a program that will take a CSV file in excel and output a certain number of lines. After searching several sites, I am frustrated as to how to get the program to recognize the file. I'm pretty sure on how to manipulate the code once the file is recognized, but until then I'm stuck. Any thoughts?
Perhaps my question wasn't as specific as it needed to be. My question is primarily on working with streams. I'm trying to input a CSV file(a file with over 50,000 entries from a dataset) using the ofstream and ifstream commands and write the first five values to the screen. Here's what I want my program to accomplish
1) Have a prompt on the executable file where I enter the file name of the CSV file
2) Display the first 5 rows of data
Where I would like some advice on is the best way to retrieve the file into my code, and then subsequently what is the best way to display the information to the screen. I am confident that I can write the code that will retrieve the first 5 lines, but how can I get that displayed?