When converting spreadsheets, use these properties on ConvertOptions to control the Markdown table output.
Column and row truncation
fromgroupdocs.markdownimportMarkdownConverter,ConvertOptionsdefspreadsheet_truncation():"""Convert a spreadsheet with column and row truncation limits."""# Step 1: Configure column and row limitsoptions=ConvertOptions()options.max_columns=8# only include the first 8 columnsoptions.max_rows=50# only include the first 50 data rows per sheet# Step 2: Convert with truncation options and save to a fileMarkdownConverter.to_file("cost-analysis.xlsx","spreadsheet-truncation.md",convert_options=options)# Truncated columns/rows show "..." indicators.# Warnings are reported in ConvertResult.warnings.if__name__=="__main__":spreadsheet_truncation()
cost-analysis.xlsx is sample file used in this example. Click here to download it.
fromgroupdocs.markdownimportMarkdownConverter,ConvertOptionsdefspreadsheet_sheets():"""Convert a workbook with custom sheet separators and hidden sheet filtering."""# Step 1: Configure sheet separator and hidden sheet behavioroptions=ConvertOptions()options.sheet_separator="\n---\n"# horizontal rule between worksheetsoptions.include_hidden_sheets=False# skip hidden worksheets (default)# Step 2: Open the workbook with a context managerwithMarkdownConverter("cost-analysis.xlsx")asconverter:# Step 3: Convert and save the Markdown outputconverter.convert("spreadsheet-sheets.md",convert_options=options)if__name__=="__main__":spreadsheet_sheets()
cost-analysis.xlsx is sample file used in this example. Click here to download it.