读取巨大的csv文件并绘制值的最快方法 [英] Fastest way to read a huge csv file and plot the values
问题描述
我需要读取大约80000条记录的csv文件,并在图表和谷歌地图上绘制特定的单元格值
我使用CSV Helper,GMAP和Windows Charts完成此任务。但是以下两种尝试都需要很长时间:
1.将数据读入列表并将其绘制在地图和图表上
2.直接尝试绘制数据渲染表格后无响应几秒钟
有没有办法可以使用async-await来完成这项任务。或者我可以使用任何其他集合来通过索引更快地访问数据值吗?
我读到字典和hashset不保留订单所以使用的列表。
谢谢
我尝试过:
使用列表作为数据持有者和数据来源,
打开文件并在我阅读时绘图
I need to read a csv file of around 80000 records and plot specific cell values on a chart and google map
I use CSV Helper, GMAP and Windows Charts to get this task done. But both of the below attempts take very long:
1. reading data into lists and plotting them on map and charts
2. directly trying to plot data renders forms unresponsive after a few seconds
Is there a way I can use async-await to accomplish this task. Or could i use any other collection for faster access of data values by index?
I read that dictionary and hashset don't preserve order so used lists.
Thank you
What I have tried:
using lists as data holders and data sources,
opening the file and plotting as i read
推荐答案
我首先要阅读这个
c# - 在.NET中处理大型csv的最有效方法 - Stack Overflow [ ^ ]
I would start by having a read of this
c# - Most efficient way to process a large csv in .NET - Stack Overflow[^]
使用:
Application.Doevents();
保持表单的响应。
这篇关于读取巨大的csv文件并绘制值的最快方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!