monitorjbl / excel-streaming-reader

An easy-to-use implementation of a streaming Excel reader using Apache POI
Apache License 2.0
943 stars 342 forks source link

added StreaminCell.getRawContents() #226

Open kommradHomer opened 3 years ago

kommradHomer commented 3 years ago

our customers usually upload excel files with phone numbers in numeric cells. Getting the raw content is the only healthy way to get the phone number, without any modification. I'm sure many will find the rawContents to be the solution in hopeless cases

Bzil commented 3 years ago

@monitorjbl it's possible to merge and release this?

cc @StanBertrand

nexuszjq commented 2 years ago

Our project upgraded xlsx-streamer version from 1.0.0 to 2.1.0 for fixing vulnerabilities, but we found out StreaminCell.getRawContents() has been removed. Will this method be added back or provide a way to replace it in the future?

pjfanning commented 2 years ago

could you use 'public double getNumericCellValue()' on Cell instead?

nexuszjq commented 2 years ago

could you use 'public double getNumericCellValue()' on Cell instead? Thanks for reply, I hope to get the 'rawContents' and convert it to 'String', use like this: '(String) streamingCell.getRawCotents()'. Can I use 'public String getStringCellValue()' instead?

pjfanning commented 2 years ago

Use POI DataFormatter to get the Cell content as a String that matches what appears in the Excel file. https://poi.apache.org/apidocs/dev/org/apache/poi/ss/usermodel/DataFormatter.html#formatCellValue-org.apache.poi.ss.usermodel.Cell-