如何在C#中创建Excel的字典
我有像这样的excel:
productid | soming shosexplanation | shotercolumn1 | 另一个column2 | 另一个column3 |
---|---|---|---|---|
1 | x | 6 | a | 65465 |
2 | y | 5 | b | 6556 |
3 | z | 7 | c | 65465 |
我想创建词典,该字典是键值(这是progienceid as progucateid as Productid,sopplantranation,soseexplanation,sothercolumn1,sherecolumn2,eytercolumn2,eytercolumn2,又是另一个dictifty3)必须具有值列表(例如字典键:productid及其值:1,2,3等),我认为必须有包含所有字典的列表。
我正在使用Aspose库作为Excel和.NET Framework 4.5。
Aspose将其单元格值返回为对象。
因此,我的第一个问题如何创建字典列表,这些词典必须具有值列表(list< dictionary< key,值列表>>),以及如何将值添加到此字典列表中?
我的第二个问题:如何用Aspose工作表填写此词典列表?
I have excel like this :
ProductID | SomeExplanation | AnotherColumn1 | AnotherColumn2 | AnotherColumn3 |
---|---|---|---|---|
1 | X | 6 | A | 65465 |
2 | Y | 5 | B | 6556 |
3 | Z | 7 | C | 65465 |
I want to create Dictionary that key values(which are ProductID, SomeExplanation,AnotherColumn1,AnotherColumn2, AnotherColumn3) and this dictionary must have List of values (for example dictionary key : ProductId and it's values : 1,2,3 etc..) and I think there must be List that containes all dictionaries.
I am using aspose library for excel and .net framework 4.5 .
Aspose returning the it's cell values as an object.
So my first question how can create List of dictionaries, and these dictionaries must have list of values (List<Dictionary<key,List of values>>) and how to add values to this List of dictionary ?
My second question with that : how can I fill this list of dictionaries with aspose worksheet ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是接受 Aspose Worksheet 作为参数的方法,该工作表参数可以是 Excel 文件的工作表之一。
我想遍历所有单元格并将值分配给字典,并且该值属于其标题(0行和列顺序)
例如:有一个名为
myExcelContainer
的列表,该列表是一系列Excel columns 并且此列是一个字典,其中包含值键(Excel 标题 - 例如ProductId
)以及 Excel 标题下的值 [1, 2, 3]。这是 Excel 容器:
但是如果您可以提高我希望您分享的算法性能,请。
我的英语不太好:)。
This is method that accept Aspose Worksheet as a parameter this worksheet parameter can be one of the excel files' worksheet.
I want to iterate through all cell and assign values to dictionary, and this values belong to its header(0 row and columnOrder)
For example: there is a list called
myExcelContainer
and this list is a series of Excel columns and also this columns is an dictionary that contains key of value (Excel header - for exampleProductId
) and the values [1, 2, 3] under the Excel header.this is the excel container :
But If you can improve the algortihm performance I want you to share, please.
My english not great :) .