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

Free Support Forum - aspose.com

Must specify delimiter for tab delimited file

I wonder if it would be reasonable and fast to just “sniff” the file to see if it is tab delimited (as is done for csv, xls, xlssx etc) to avoid a special code path for tab delimited files?

Hi,

Well, currently you have to either specify a delimiter char for the text file or use FileFormatType.TabDelimited enum for the tab delimited text file while opening it (i.e.., you have to choose proper overloaded version of the Workbook.Open() method for it) : http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net-and-java/opening-files.html We will check if we can support to auto-detect the format type for the tab delimited text file.

Thank you.

Thanks for your reply…
I’m using this code now to do the parse

                if (GetAsposeFormat() == FileFormatType.Default)
                    _Workbook.Open(ms);
                else
                    _Workbook.Open(ms, GetAsposeFormat());

I’ve added a method GetAsposeFormat that returns one of your enumerated types…
BUT
when i use FileFormatType.Default as the 2nd arg to the Open method I don’t get the same behavior as I do when i use no file format argument.



With no arg xlsx and xls (of any version of excel) are opened just fine.
If I use FileFormatType.Default xlsx files are not opened.



I suspect Default does not mean what I think it means, but there does not seem to be a
FileFormatType.Automatic enum member which would eliminate that if/else awkwardness.


Hi,

FileFormatType.Default is same as Excel2003 in Aspose.Cells now. If you do not want to specify the file format ,please use Workbook.Open(string filename) or Workbook.Open(Stream stream) method. But for the table delimited file, you still have to specify the file format or separator.