SpreadSheetGear - 从Excel列中读取唯一值 [英] SpreadSheetGear - read unique values from Excel column
问题描述
我想在Excel工作表中使用SpreadSheetGear(.NET)读取一列,并在该列中获取唯一的值。
I want to read a column in Excel worksheet using SpreadSheetGear (.NET) and get unique values in that column back.
示例:从上述Excel工作表中,我需要阅读列B并获取唯一值
John
Mike和
Wayne
Example: From the above Excel worksheet, I need to read column B and get back unique values "John" "Mike" and "Wayne"
在现实生活中,可以有1,000,000+行,所以效率很重要。
这是如何实现的?
In real life, there can be 1,000,000+ rows so efficiency is important. How is that achieved?
推荐答案
我明白这篇文章很旧,但可能对他人有帮助:
@Michael Moreno输入的评论将是有帮助的,我赞同这一想法。但是关心的是:如何判断迭代循环的行数或列数。为此,我建议Property IWorksheet.UsedRange
获取表格中包含的数据范围。
Curtsy由:@Chris在他的线程
I Understand that the post is quite old but could be helpful for others:
The comment entered by @Michael Moreno will be helpful and I endorse the idea. But the concern is: How one can judge the number of rows or columns to iterate the loop. For this I suggest the Property IWorksheet.UsedRange
to get the range of data contained by sheet.
Curtsy by: @Chris in his thread
这篇关于SpreadSheetGear - 从Excel列中读取唯一值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!