Conversion Excel to TXT

Hi,
I’d like to convert XLS to TXT but only some columns. Each column with a specific size. Aspose.Cells can help do this?

Hi,

Well, I think you may export/convert an XLS file to txt file format. See the below code:

Sample code:

Workbook workbook = new Workbook(“e:\test\Book1.xls”);
//Instantiate Text File’s Save Options
TxtSaveOptions options = new TxtSaveOptions();
//Specify the separator
options.Separator = Convert.ToChar(“;”);
//Save the file with the options
workbook.Save(“e:\test\abc.txt”, options);

Also please the online document to know which file format are supported for conversion:
https://docs.aspose.com/display/cellsnet/Different+Ways+to+Save+Files


If you want some specific columns to exported in the XLS file to txt file format, you may either fill the value as “null” e.g Cell.PutValue(“”) or Cell.PutValue(null) for the cells in the column, you may loop through the cells in a column easily.

Or you may remove the column using: Cells.DeleteColumn() method, see the document:
https://docs.aspose.com/display/cellsnet/Inserting+and+Deleting+Rows+and+Columns
before converting to .txt file format.

Thank you.