更新 CSV 文件中的数据

发布于 2024-10-19 06:07:45 字数 178 浏览 1 评论 0原文

大家好,我想使用 C 程序从 CSV 文件中读取和写入数据。但我的问题是,在运行时我的数据在行和列上都在增加。这意味着它在两个方向上不断更新。

有什么方法可以让我找到下一个列或行,例如(第 4 行,第 3 列)并将我的数据放入其中,

而且所有行不必填充相同数量的列 任何帮助将不胜感激,

谢谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一枫情书 2024-10-26 06:07:45

如果准备好了,为什么不将数据保存在内存中并将其写入 csv 文件呢?或者另一种选择,只是用换行符作为新数据元素即将到来的指示器?或者也许可以选择考虑某种可以使用和修改的结构,最后写出 .csv 文件?
或者,如果结构不均匀,为什么还要坚持使用 csv?

因为我的回答有点隐藏在评论中。当前所有评论的建议是他需要一种从 csv 文件中读取内容的方法。除此之外,他还必须跟踪他想要跟踪的内容(IP 连接),并且该文件可以在 30 秒左右的时间内重新生成。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文