Problem trying to hide CSV file columns

Dear Support:

I am trying to hide some columns from a CSV file starting at specifiedc column index using the following code:

FileStream fstream = new FileStream(myPath, FileMode.Open);

LoadOptions lo = new LoadOptions(LoadFormat.CSV);

Workbook wk = new Workbook(fstream,lo);

Worksheet ws = wk.Worksheets[0];

ws.Cells.HideColumns(22, 4);

wk.Save(mySavePath,fstream.Close();

The code runs with no problem but when I open the file the columns are not hidden. I am attaching the file I am using.. can you please advise?

Thank you much

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

Thank you for contacting support.

As your issue is related to Aspose.Cells product, I am moving this thread to Aspose.Cells forum where Aspose.Cells support team will reply to your query soon.

Thank You & Best Regards,

Hi,

Thanks for your question and using Aspose.Cells for .NET.

Please try saving your output file it in a different format, because CSV format does not support hidden columns.

You can check it using Ms-Excel.

Open your CSV file, then hide your column and save it back, then again open, you will see, your column is not hidden.

To correct your code, please change it like this.

wk.Save(mySavePath,SaveFormat.Xlsx);


Hi,

Please also see if you want to remove specified column from the csv template file and generate another csv file, then please use Cells.DeleteColumns(22, 4, false).