I am completely new to C programming and
I have a simple question that is giving me problems. This is my first time working with text files so I was hoping to get some support to quicken the learning process because I can't find much documentation on it. It seems everything is C++ on google.
Anyways I have a .fil file that was created in notepad. It is lined up like a table with records. I have opened the file ok but I can't use fscanf properly to store the data into variables.
I'm needing to skip the first line so I can get to the data. It seems no newline is processed??
I tried adding \n to the document in hopes that the stream would recognize them and jump the pointer down to the next record. It seems to be processing all the reading all the white space instead? Here's a sample of the file:
How can I skip records or get the pointer where I need it?Code:First Name Last Name Sale Day Length Width Height State Cost Area Sam Smith N 12.5000 13.5000 8.00 GA 15.75 300 Sam Collins N 15.0000 11.2500 8.00 AL 12.00 300
How can I get the data and store it into variables? Everything I have tried with the fscanf function has failed me. Can anyone help??? Much thanks to much appreciated help...