在工作表中删除重复行
Contents
[
Hide
]
删除重复行是Microsoft Excel的众多有用功能之一。它允许用户删除工作表中的重复行,您可以选择应检查重复信息的列。
Aspose.Cells为此提供了Cells.RemoveDuplicates()方法。您还可以设置startRow、startColumn、endRow、endColumn来选取列。
以下是可以下载以进行此功能测试的样本文件:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
//Create workbook | |
Workbook book = new Workbook("removeduplicates.xlsx"); | |
//Remove Duplicate | |
book.Worksheets[0].Cells.RemoveDuplicates(0 ,0, 5, 3); | |
//Save result | |
book.Save("removeduplicates-result.xlsx"); |