Home › Forums › C Programming › Help – file reading › Re: Re: Help – file reading
March 22, 2009 at 1:12 pm
#3532
msaqib
Participant
Use fgets() function to read the file line by line and then split the string and store all the values in variables.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <br /> int x = 0;<br /> while (fgets(msg,25,fp)!=NULL)<br /> {<br /> x++;<br /> if(x==0){<br /> //we do not need to read first line as it contians headings<br /> //this is the first line which you don't need to read and you can hardcode it in progrm<br /> }<br /> else{<br /> //write your rest of the program here to read the data and manipulate<br /> }<br /> <br /> }<br /> |