a file csv contain data:
now, my code is:
log error is:
trouble is empty row at end of file CSV
Is there a solution?
B4X:
item1;alfa1;beta1
item2;alfa2;beta2
item3;alfa3;beta3
empty row
empty row
now, my code is:
B4X:
Dim su As StringUtils
Dim ItemList As List
ItemList = su.LoadCSV (myPath, NameCSV, ";")
log error is:
B4X:
importcounter._leggicounter (java line: 137)
java.lang.StringIndexOutOfBoundsException: String index out of range: -1680
at java.lang.String.substring(String.java:1967)
at anywheresoftware.b4a.objects.StringUtils.ReadWord(StringUtils.java:243)
at anywheresoftware.b4a.objects.StringUtils.LoadCSV2(StringUtils.java:207)
at anywheresoftware.b4a.objects.StringUtils.LoadCSV(StringUtils.java:120)
at j.Statistiche.importcounter._leggicounter(importcounter.java:137)
at j.Statistiche.main._btcounter_action(main.java:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
at anywheresoftware.b4a.BA$1.run(BA.java:216)
at com.sun.javafx.application.PlatformImpl.lambda$null$177(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$178(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$152(WinApplication.java:177)
at java.lang.Thread.run(Thread.java:748)
trouble is empty row at end of file CSV
Is there a solution?