How to convert EXCEL to TEXT file with "~" delimited

I know there is function like convert excel file to tabDelimited text file

.new Workbook("excel file");

_workBook.Save(Text file path, SaveFormat.TabDelimited);

Is there a way to save as "~" delimited text file?

Thanks

Hi,


Well, you specify Separator while instantiating TxtSaveOptions while save a text file. See the sample code for your needs:
e.g
Sample code:

Workbook workbook = new Workbook(stringFilePath);
//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:\test2\abc.txt”, options);

Hope, this helps a bit.

Thank you.

Thank you!

It is working fine for most of our excel files, but there is one excel, output textfile contains extra lines at the end like

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Any reason for it?

Thanks.

Hi,


Well, there might be some blank cells (which are initialized or some space are inserted into those cells) in the rows/columns in your underlying worksheet in the template Excel file, so you are getting this extra contents with “~” separator as well in the output text file, please remove those blank cells and try to convert to text file via Aspose.Cells to check if it works fine. If you still find any issue or confusion, give us your template Excel file here, we will check your issue soon.

Thank you.

I didn’t see any spaces in my cells, is there a way to upload excel file here?

It should be good now, since I tried go to last cell, it went to big number rows, have to clear the extra rows first.

Thanks.

ginnywang2007:
I didn't see any spaces in my cells, is there a way to upload excel file here?


Hi,

Thanks for using Aspose.Cells.

If you click Reply button and not Quick Reply, you will get an option to attach your Excel file. You can attach your file for our reference.
ginnywang2007:

It should be good now, since I tried go to last cell, it went to big number rows, have to clear the extra rows first.

Thanks.

Hi,

Thanks for using Aspose.Cells.

It is good to know that your issue is resolved now by clearing the extra rows. Let us know if you encounter any other issue. We will look into it and update you asap.