dhatim / fastexcel

Generate and read big Excel files quickly
Other
684 stars 122 forks source link

NumberFormatException while reading document #143

Closed azapasnik closed 3 years ago

azapasnik commented 3 years ago

I'm using fastexcel-reader 0.12.0 version.

During org.dhatim.fastexcel.reader.Sheet#read it fails with NumberFormatException:

java.lang.NumberFormatException: For input string: "3.2613889831939"

    at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.base/java.lang.Integer.parseInt(Integer.java:652)
    at java.base/java.lang.Integer.parseInt(Integer.java:770)
    at org.dhatim.fastexcel.reader.RowSpliterator.parseString(RowSpliterator.java:159)
    at org.dhatim.fastexcel.reader.RowSpliterator.parseCell(RowSpliterator.java:111)
    at org.dhatim.fastexcel.reader.RowSpliterator.next(RowSpliterator.java:93)
    at org.dhatim.fastexcel.reader.RowSpliterator.tryAdvance(RowSpliterator.java:46)
    at java.base/java.util.Spliterator.forEachRemaining(Spliterator.java:326)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
    at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
    at org.dhatim.fastexcel.reader.Sheet.read(Sheet.java:55)

It fails during AJ8 cell processing. I'm not sure if I can provide full document but here is some internals that might help:

<row r="8"><c r="A8" t="s"><v>54</v></c><c r="B8" t="s"><v>55</v></c><c r="C8" t="s"><v>56</v></c><c r="D8" t="s"><v>57</v></c><c r="E8" t="s"><v>58</v></c><c r="F8" t="s"><v>59</v></c><c r="G8" t="s"><v>59</v></c><c r="H8" t="s"></c><c r="I8" t="s"></c><c r="J8" t="s"></c><c r="K8" t="s"><v>60</v></c><c r="L8" t="s"><v>61</v></c><c r="M8" t="s"><v>62</v></c><c r="N8" t="s"><v>63</v></c><c r="O8" t="s"><v>64</v></c><c r="P8" t="s"></c><c r="Q8" t="s"><v>65</v></c><c r="R8" t="s"></c><c r="S8" t="s"></c><c r="T8" t="s"><v>66</v></c><c r="U8" t="s"><v>66</v></c><c r="V8" t="s"></c><c r="W8" t="s"></c><c r="X8" t="s"><v>67</v></c><c r="Y8" t="s"></c><c r="Z8" t="s"></c><c r="AA8" t="s"></c><c r="AB8" t="s"></c><c r="AC8"><v>1900</v></c><c r="AD8" t="s"></c><c r="AE8" t="s"></c><c r="AF8"><v>1900</v></c><c r="AG8" t="s"></c><c r="AH8" t="s"></c><c r="AI8"><v>11000</v></c><c r="AJ8" t="s"></c><c r="AK8" t="s"></c><c r="AL8" t="s"></c><c r="AM8" t="s"></c><c r="AN8" t="s"></c><c r="AO8" t="s"></c><c r="AP8" t="s"></c><c r="AQ8"><v>3.2613889831939</v></c></row>

Looks like r.goTo("v"); in org.dhatim.fastexcel.reader.RowSpliterator#parseString returns value for AQ8 cell