![]() |
| ||
| Reading data from a textfiletype Im trying to read some integers values from a text file. The problem is that first lines of the text files contains some text and only then theres the values that i want to read into variables , and i dont know how to get down three lines and then read using fscanf . TEXT FILE(storeinfo.txt): Stores Information: Store Code Store Size Store Workers Store Income 951 1200 7 67000 952 1452 12 92833 953 800 5 41000 954 1000 6 61000 955 1500 12 100321 Code: #include <stdio.h> |
| ||
| Re: Reading data from a textfiletype Keep a counter which will be initialized to 1, fgets the entire line of text in a character array, skip the first two lines using the counter previously mentioned and start reading from the third line.Read this for using fgets. |
| ||
| Re: Reading data from a textfiletype can you please post a code example ? |
| ||
| Re: Reading data from a textfiletype #include <stdio.h> |
| ||
| Re: Reading data from a textfiletype Thanks for the help guys ! |
| All times are GMT -4. The time now is 7:58 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC