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

Free Support Forum - aspose.com

NumberFormatException: For input string: "" during importCSV()

We’re using Aspose.Cells for Java 8.2.2.3.


We have a text file “test.csv” with one line:

0e61~18~abc~-~-~-~-~-~-~-~def~hij~-~mno~pqr~

When trying to import the above:

final Workbook workbook = new Workbook();
final Worksheet sheet = workbook.getWorksheets().get(0);
final Cells cells = sheet.getCells();
final TxtLoadOptions options = new TxtLoadOptions();
options.setSeparatorString("~");

cells.importCSV(“C:\test.csv”, options, 0, 0);

We get this error:

Exception in thread “main” java.lang.NumberFormatException: For input string: “”
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Long.parseLong(Unknown Source)
at java.lang.Long.parseLong(Unknown Source)
at com.aspose.cells.b.a.zp.a(Unknown Source)
at com.aspose.cells.zanx.c(Unknown Source)
at com.aspose.cells.zanx.a(Unknown Source)
at com.aspose.cells.zbix.a(Unknown Source)
at com.aspose.cells.zbix.b(Unknown Source)
at com.aspose.cells.zbix.a(Unknown Source)
at com.aspose.cells.zbix.a(Unknown Source)
at com.aspose.cells.Cells.importCSV(Unknown Source)
at asposetest.AsposeTest.main(AsposeTest.java:36)

We tried importing the same file in Excel 2007 by simply opening it and going through Excel’s import wizard (selecting delimiter as ~), and Excel was able to import it fine.

Please advise.

Hi,


Thanks for providing us some details and sample code.

After an initial test, I observed the issue as you mentioned by using his sample code with a simple template file. I got:
NumberFormatException: For input string: “” during importCSV()
while importing the CSV file (I created the CSV file manually into notepad as per your contents). I have logged a ticket with an id “CELLSJAVA-41092” for your issue. We will look into it soon.

Once we have any update on it, we will let you know here.

Thank you.

Hi,


Please try our latest fix/version: Aspose.Cells for Java v8.3.0.1


We have fixed your issue now.


Let us know your feedback.


Thank you.

Hi Amjad,


Yes, it is working fine with 8.3.0.1.
Thanks!

Simon

Hi,


Thanks for your feedback.

Good to know that your issue is fixed now. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

Thank you.

The issues you have found earlier (filed as CELLSJAVA-41092) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.