In course of my long assignment which should include arrays of classes, sorting, etc. I need to get my information from regular data file and read it into array. The data file should have 3 columns with integers and one additional (in the middle) with name (up to 20 characters). I can read data from one column but cannot find the way to get from all 3 columns. Can anybody give me some clue how should I do this (I am mostly using c libraries for now and trying to use *.CSV file as a regular data file).
Thank you
CLUE #1:CSV = Comma Seperated Value. Try opening a CSV file with notepad. Then start a fresh instance of notepad and enter the following data:
Name, Billy, Bob
Save this file with a .CSV extention instead of .txt. Remember Windows will only count the last extension so FILE.CSV.txt will be read as a text file. Then open the file again with Excel, Calc or something
Thank you
What I actually need to know for CLUE#2:
Professor doesn't want to specify which file to use and saying only that I should use a REGULAR DATA FILE. I assumed that a regular data file that has the following info in columns (employee IDs, Names, Cost of Goods , etc.) and those columns have many lines of data -- would be the file with ext. .CSV . Am I correct or a REGULAR DATA FILE in such a case should be just .TXT file (or maybe there is no difference???)
ISLT. No, there is a difference. Parsing data in a way that will not harm the data regardless of content is one of the trickest parts of establishing a new file type. That's why there are so many formats.
To me a "Regular Data File" means plain text or else CSV like you said. But in order to be certain this might be a situation where you want to consult a peer in your class, or possibly a TA who knows that teachers style if one is avalible.
Thank you.
I understand this part now.
As a matter of fact I sent my professor an email asking what file format to use and that was his answer (REGULAR DATA File) :(( . So I'm going to use .CSV as I thought and as you told me.
If there would be so easy to get some answer for the first part of my question as I got it for the second part that would be just great. Thank you
As a matter of fact I sent my professor an email asking what file format to use and that was his answer (REGULAR DATA File) :(( . So I'm going to use .CSV as I thought and as you told me.
Officially my answer is to consult a TA that has had this teacher or a peer in your class as to what file format to expect. I must discourage "guessing" about this because the chances are that we will be wrong.