The first thing you need is to gather the right tools. In this case can you view the CSV file that you will be reading from by opening it in Notepad so you know that it is intact? Do you know how to open/create a file? Do you know the various variable types available to you in C++? Do you know about the various options available forreading into strings using getline()? If the file you are reading has numerical fields and you wish to do calculations using the numerical values do you know how to convert strings into numerical values? Do you know how to write native types (and user defined types if needed) to the screen (which will basically be the same way you write them to file)?
If you know all of that, then you can write the program without any major problems. If not, learn a given concept in a smaller program first and then try to use that experience to do what is needed with that concept in your program.
Lerner
Nearly a Posting Maven
2,406 posts since Jul 2005
Reputation Points: 739
Solved Threads: 405
Skill Endorsements: 9
I would suggest getting a compiler from this century, then reading up on ifstream.
MosaicFuneral
Posting Virtuoso
1,699 posts since Nov 2008
Reputation Points: 888
Solved Threads: 118
Skill Endorsements: 7
We don't do 'code to order' feel free to post your code and we'll help you work through your problems.
Or ask a much more specific question like 'How do I open a file'? if you can't find it on google (or equivalent)
Murtan
Practically a Master Poster
671 posts since May 2008
Reputation Points: 344
Solved Threads: 116
Skill Endorsements: 0
Without knowing more about your skill set and specifics about what you are trying to, and in the spirit of not doing everythnig for you, I suspect I might end up with something looking like this as the guts of the prototcol used for reading of the file:
while(getline(fin, a[i++], ','));
Now I'd suggest using the reference material you have available/acculated over the last year to figure out what that line is doing and the importance of each part of it. (Feel free to point out it's weaknesses, too, so you can improve upon it!)
To use it. or something like it, in a program you will need to declare the individual parameters/variables used and initialize/associate them with appropriate values before you can get the line to work. Posting appropriate portions of your own code and asking for help when you get stuck like Murtan said is an excellent learning opportunity.
Lerner
Nearly a Posting Maven
2,406 posts since Jul 2005
Reputation Points: 739
Solved Threads: 405
Skill Endorsements: 9