How to Detect the File Format

Hello @ all,

this HowTo works correct with a CSV-File only by detecting the file format using file path.

By using via stream I get "Unknown ".

What do I wrong?

Thx.

Hi Felix,

Thank you for your inquiry. Please use the latest version of Aspose.Cells for .NET 7.6.0.7 for your testing. It should work as expected. In case your problem persists, please provide your sample file for our review. We will look into this very soon.

I just tested with the latest Aspose.Cells version 7.6.0.7. The file format via stream is still the same - "Unknown".

Here my Steps:

1. I copied the C# code from here: HowTo into my c# console application (VS2010).

2. I started MS-Excel 2010 and wrote into the first 2 Columns a text: Hello World.

3. I saved this Document as CSV (comma separated)(*.csv)

4. I modified the filePath-variable in source code to my own, refreshed the reference and started the example.

thx.

Hi Felix,

Please accept our sincere apologies for your inconvenience.

I have evaluated your presented issue on my end with latest version of Aspose.Cells for .NET 7.6.0.7. I have noticed that CellsHelper.DetectFileFormat cannot detect the file format if CSV is loaded through stream. Whereas the said method is working fine for other formats such as XLS and XLSX.

A ticket (CELLSNET-42152) has been logged in our bug tracking system to look further into this matter. Please spare us little time to properly analyze the problem cause and to provide a fix. In meanwhile, we will keep you posted with updates in this regard.

Hi Felix,

Thanks for using Aspose.Cells.

We are afraid, we could not support detecting the csv file format because we could not find which character is separator in a txt file.