0

hi every one i want to read and write data from a CSV file using c program. but my problem is that at run time my data is increasing in both row wise and column wise. that means it is continuously updating in both direction.

is there any way through which i can find the next colum or row for eg (row 4 ,col 3) and place my data into it

one thing more it is not necessary that that all rows have same number of column filled any help would be appreciated

thanks

1
  • Do you mean CSV rather than CVS? Commented Feb 24, 2011 at 7:25

1 Answer 1

2

Why don't you keep the data in memory and just write it out to an csv file if you are ready? Or another option, just us a line feed as indicator that a new data element will come? Or maybe it would be an option to think about some kind of structure you can use and modify and just in the end you write out the .csv file? Or well if the structure is that inhomogenous why stick to csv?

Because my answer is somewhat burried in the comments. The current suggestion with all the commens is that he needs a way to read in something from a csv file. Than that he has to keep track of the things he wants to track (IP connections) and that the file can be regenerated all 30 or so seconds.

Sign up to request clarification or add additional context in comments.

14 Comments

actually i want to store data which is updating in both direction text file will creat a mess so i thought cvs woulf be fine. also i need that datato make a graph . can u suggest me any other way that how to store that data
I'm sorry but you do not have posted your "goal" really. There are other ways of storing away things. You can e.g use some Database be it in a structured ways like (relational databases) you can use things like Databased which you access via keys. E.g Berkeley DB or any other NoSQL database. You can write out JSON stuff to disk, you can use XML. In you case maybre JSON would be an option?
+1 for "why stick to CSV". The proper way to solve this is to use in-memory data structures and translate those from and to CSV, not to edit CSV files in-place.
but the data is increasing in both direction how to cator that? is there away to keep a pointer like can i access something like that in cvs file [row ,col]. plz help thanks so much
one thing more cant use data base because my program need alot of cvs file all will be created at run time and will be updated conrinously ...thanks
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.