We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Excel to txt conversion

I want to convert .xls file to .txt file , we got aspose license..I need your support link for this in C#.net


This message was posted using Aspose.Live 2 Forum

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for considering Aspose.

Please see the following sample code to save an xls file to txt file.

//Instantiating a Workbook object

Workbook wrkBook = new Workbook();

//Open the Xls file

wrkBook.Open("D:\\book1.xls");

//Save the file as Tab delimited text file

wrkBook.Save("D:\\book1.txt",FileFormatType.TabDelimited);

Please see the following documentation links for further details about opening and saving the file in different file formats.

http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/opening-files.html

http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/saving-files.html

If you need any further assistance, please feel free to contact us. We will be happy to help you out.

Thank You & Best Regards,

The code you provided us works as expected and now I have to do one more customization while saving the text file. In short I have to save the file in FileFormatType.PipeDelimited.

wrkBook.Save("D:\\book1.txt",FileFormatType.TabDelimited);

Instead of TabDelimited, how can I do it with a Pipe(|), any suggestion/Quick reply on this is much appriciated.

Hi,

Well, I think you may try:

wrkBook.Save(“D:\book1.txt”,’|’);

Thank you.