Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Sometimes, your Excel or CSV file has leading blank columns or rows. For example, consider this line
,,,data1,data2Here, the first three cells or columns are blank. When you open such a CSV file in Microsoft Excel, Microsoft Excel discards these leading blank rows and columns.
By default, Aspose.Cells does not discard leading blank columns and rows on saving, but if you want to remove them just like Microsoft Excel does, Aspose.Cells provides the TxtSaveOptions.TrimLeadingBlankRowAndColumn property. Set it to true, and all the leading blank rows and columns will be discarded on saving.
The following sample code loads the source Excel file, which has two leading blank columns. It first saves the Excel file in CSV format without any changes, and then sets the TxtSaveOptions.TrimLeadingBlankRowAndColumn property to true and saves it again. The screenshot shows the source Excel file, the output CSV file without trimming, and the output CSV file with trimming.

Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.