CSV sheet which has data like 5641E11,6411E11,6678E12, showing in excel exponential value after merging CSV. Attached ZIP file having CSV sheet1 and Report excel.ASPOSE JAR MERGE ISSUE.zip (6.0 MB)
This is not an issue with Aspose.Cells by any means rather MS Excel’s behavior. For confirmation, you may open a new Workbook in Ms Excel manually and input some scientific value(s) e.g “6411E13” into a cell (e.g A1) and then press Enter, you will notice that it will return/display as “6.41E+16”. To cope with it, you may try the following sample code, it will work for your needs:
TxtLoadOptions opts = new TxtLoadOptions(LoadFormat.CSV); opts.setSeparator('|'); opts.setConvertNumericData(false); Workbook workbook = new Workbook("e:\\test2\\daee92570a82f94127a238432a9bb37c_Sheet1.csv", opts); workbook.save("f:\\files\\out1.xlsb", SaveFormat.XLSB);
Hope, this helps a bit.
Tried using below code, still getting exponential value on CSV file.
var txtLoadOptions = new TxtLoadOptions(); txtLoadOptions.Separator = delimiter; txtLoadOptions.ConvertDateTimeData = false; txtLoadOptions.ConvertNumericData = false; var excelFile = new Workbook(csvFileLocation, txtLoadOptions);
Example value: 25460E281
Getting this exponential value: 2.55E+285
Aspose.Cells Version: 18.104.22.168
Since you are using an older version of the product (Aspose.Cells v22.214.171.124), so we cannot evaluate your issue. Neither we could include any fix to the older version. We recommend you to kindly upgrade to and try latest version of the APIs (e.g. Aspose.Cells 21.7) and then try your scenario/case. If you still find any issue, kindly do share your template CSV file, we will check it soon.
PS. please zip the file(s) prior attaching here.