CSV文件分析,哪种方法是最佳解决方案 [英] CSV file analysis, which method is the best solution

查看:85
本文介绍了CSV文件分析,哪种方法是最佳解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我在开发visual c#中的应用程序方面相当新。我读了一些书,浏览了一些在线教程并做了一些课程。

现在我正面对我的第一个项目,不知怎的,我几天都在苦苦挣扎。

i'd真的很感激,如果有人可以通过回答我的帖子/问题来指出我正确的方向。我不确定我是否在正确的道路上解决我的运动。



任务

i有代表我的数据的不同csv文件(来源:一些测量系统)。

两个文件的内容应该加载到我的c#程序中。

经过一些清理后(删除一些应符合某些条件的行和列)我想将两个内容合并到一个视图/列表/数据网格中。

选择一些复选框等。显示的内容应该被过滤,最后它应该是保存到csv或导出到MS Excel例如。



当前状态

i我正在阅读我的csv文件两个datagridviews。

按下一个按钮之后,清理工作不正常,因为某些行未从视图中正确删除。再次按下按钮后会删除更多行...这令我感到沮丧。

如果这样可行...我的下一步是将dataviewgrid的内容合并为一个一个应该显示在c#程序中。



好​​吧,我问过一些人......

- 一个人被告知我建立一个单例类并通过使用一堆列表解决我的问题

- 另一个人告诉我使用动态的arraylists



我现在有点困惑因此我想错过森林的树木......任何人都可以为我的小脑子注入正确的想法吗?



提前感谢,

andy



(ps。因为我不是来自英语为母语的国家,请原谅我的拼写)

hi folks,

i am pretty new in developing applications in visual c#. i read some books, browsed some online tutorials and did some courses.
now i am facing my first project and somehow i am struggling around since a few days.
i´d really appreciate it if someone could point me to the right direction by answering to my post/question here. i am not sure if i´m on the correct path in solving my exercise.

task
i have to different csv files which represent my data (source: some measuring systems).
the content of both files should be loaded into my c#-program.
after some cleanup (deleting some rows and columns which should match some criteria) i want to merge both contents into one view / list / datagrid.
by selecting some checkboxes etc. the displayed content should be filtered and finally it should be save into a csv or exported to MS Excel for example.

current state
i am reading my csv files into two datagridviews.
after pressing a button the cleanup does not work perfectly as some rows are not correctly deleted from the view. after pressing the button again some more rows are deleted ... this is frustrating me at the moment.
if this would work ... my next step is to merge the content of both dataviewgrid into a single one which should be displayed in the c#-program.

well, i´ve asked some people ...
- one person told me to build a singleton class and to resolve my problem by using a bunch of lists
- another person told me to use arraylists which are dynamic

I am a little bit confused an the moment hence I think to miss the forest for the trees... can anyone infuse my little brain with the correct idea please?

thanks in advance,
andy

(ps. since i am not from a country where english is the native language please excuse my spelling)

推荐答案

好吧,我认为所有那些曾经试图帮助过你的人,虽然意义重大,但都是......错误



你不只是从问题转到编写代码 - 中间有一些步骤,这些都是分析,设计的等等 - 从那里你会建立一个'计划'和测试它所需的步骤 - 是吗?



你显然已经有一些步骤



1)读取文件

2)显示文件

3)清理

4)合并文件

5)过滤器

6)写上



如果你正确地测试了每个步骤之前你去了更复杂的步骤,比如'合并',那么你就不会那么担心了



我不一定能看到单身人士类,arraylists等会有什么帮助,除非你开始使用ON PAPER,将所有内容分解为最小的元素,然后考虑解决方案,数据结构,测试,然后进行实施 - 没有多少技术可以解决不完整的思考过程ss



bitte verzeihen Sie meine Manieren - ichmöchtenichtunhöflichsein(不是谷歌很棒 - 我曾经说过一点德语,至少我比总统肯尼迪更好!)



无论如何 - 这对你有什么帮助? ..我认为你应该把所有东西都打破 - 然后开始一个新项目(不要扔掉旧项目) - 例如构建一些小原型来帮助你获得清理的逻辑正确...一旦你测试了新程序的阶段/步骤,然后转到下一位......
Well, I think all those people who tried to help you before, while well meaning and all, were ...wrong

You don't just go from 'a problem' to writing code - there's steps in the middle, that go along the lines of analysis, design etc - from there you would have built a 'plan' and the steps required to test it - yes ?

You've clearly got some steps there

1) read file
2) display file
3) cleanup
4) merge files
5) filter
6) write

if you tested each step properly BEFORE you went onto the more complex steps like 'merge', then you wouldn't be so worried

I don't necessarily see how singleton classes, arraylists etc are going to help, unless you start ON PAPER, by breaking everything down to its smallest possible element, then thinking about solutions, data structures, tests, and then doing the implementation - no amount of technology is going to be able to unravel an incomplete thought process

bitte verzeihen Sie meine Manieren - ich möchte nicht unhöflich sein (isn't google great - I used to speak a little German, at least Im better than President Kennedy !)

Anyway - how does this help you ? .. I think you should break everything down on paper - then start a new project (don't throw away the old one) - build some little prototypes for example to help you get the logic for the cleanup correct .. once you have tested a 'phase/step' of the new program, then move onto the next bit ..


这篇关于CSV文件分析,哪种方法是最佳解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆