Excel Tablosunu Veri Aralığına Dönüştürme
Contents
[
Hide
]
Excel Tablosunu Veri Aralığına Dönüştürme
Aspose.Cells for Python via Java, Excel Tablosunu bir veri aralığına dönüştürme seçeneği sunar. Bunun için API,ListObject.convertToRange yöntem. Aşağıdaki kod parçacığı, kullanımını gösterirListObject.convertToRange bir Excel tablosunu bir veri aralığına dönüştürme yöntemi.
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
source_directory = "Examples/SampleFiles/SourceDirectory/" | |
output_directory = "Examples/SampleFiles/OutputDirectory/" | |
workbook = Workbook(source_directory + "Book2.xlsx") | |
# Convert the first table/list object (from the first worksheet) to normal range | |
workbook.getWorksheets().get(0).getListObjects().get(0).convertToRange() | |
# Save the excel file. | |
workbook.save(output_directory + "ConvertTableToRange_out.xlsx") |
Bir Excel Tablosunu Seçeneklerle Aralığa Dönüştürme
Bir tabloyu aralığa dönüştürürken ek seçenekler sağlayabilirsiniz.TableToRangeOptions sınıf. örneğini iletebilirsinizTableToRangeOptionssınıfaListObject.convertToRange ek seçenekleri belirtmek için yöntem. Aşağıdaki kod parçacığı,TableToRangeOptionstablonun son satır dizinini ayarlamak için sınıf. Tablo biçimlendirmesi, belirtilen satır dizinine kadar korunacak ve biçimlendirmenin geri kalanı kaldırılacaktır.
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
source_directory = "Examples/SampleFiles/SourceDirectory/" | |
output_directory = "Examples/SampleFiles/OutputDirectory/" | |
workbook = Workbook(source_directory + "Book2.xlsx") | |
# Convert the first table/list object (from the first worksheet) to normal range | |
tableToRangeOptions = TableToRangeOptions() | |
tableToRangeOptions.setLastRow(5) | |
# Convert the first table/list object (from the first worksheet) to normal range | |
workbook.getWorksheets().get(0).getListObjects().get(0).convertToRange(tableToRangeOptions) | |
# Save the excel file. | |
workbook.save(output_directory + "ConvertTableToRangeWithOptions_out.xlsx") |