Comments (6)
While debugging this further, I've also noticed that the Implementation of Reader::next()
returns the current value, while the Iterator
interface defines the return as void. This doesn't waste much performance, but is still unnecessary, especially given the additional call to adjustRowOutput()
. During iteration the value will always be obtained via a separate call to current()
.
from xlsx-reader.
Hey there,
The just-released version v0.10.0 should address these issues now. Please check it out.
To make the reader behave in the way you described, configure it similarly to this:
$reader = new Reader(
(new ReaderConfiguration())
->setSkipEmptyRows(ReaderSkipConfiguration::SKIP_TRAILING_EMPTY)
);
If you wish to skip all empty rows instead of only trailing ones, replace SKIP_TRAILING_EMPTY with SKIP_EMPTY.
Sidenote, if you happen to make use of SkipEmptyCells:
Be advised that SkipEmptyCells now also requires ReaderSkipConfiguration values, making its interface similar to that of SkipEmptyRows. You may need to adapt your usages accordingly.
from xlsx-reader.
Thank you for your work!
Sadly, I was unable to test the new feature, or even get the new library version to run due to two breaking changes you introduced...
ReaderConfiguration::setSkipEmptyCells()
used to enforce a boolean argument, now enforces an integer constant, which results in an InvalidArgumentException with our old code. Not a major problem, but still undesirable for a minor version release.- More importantly for us, ITST-21347 has changed the semantics of
ReaderConfiguration::setReturnUnformatted()
. In version 0.9, it did not affect date values, i.e. it could be used in conjunction withReaderConfiguration::setReturnDateTimeObjects(false)
and the format setters to receive ISO8601 strings for date values, which is what we did. In version 0.10, the unformatted directive now takes precedence and thus an internal Excel date floating point representation is returned. We can open a separate issue to discuss this further if desired.
from xlsx-reader.
1.: Yes, that's what I wanted to point out with the sidenote I added to the end of my previous comment. That integer should be a ReaderSkipConfiguration constant now. It behaves the same way the new option setSkipEmptyRows() does.
Regarding your versioning concerns, be advised that this library is currently using a version <v1. This implies slightly different semantics for the versioning pattern. In particular, it implies that all version updates should be considered unsafe.
To at least provide a bit of safety though, this library adheres to the behavior e.g. composer exposes when dealing with such versions, which is that the 2nd digit of the version is considered the "major" one. As such, in the context of this library, for breaking changes, said digit of the version number will be bumped, and for minor releases, the following ones.
(e.g.: v0.8.0 -> v0.9.0: major release, v0.8.0 -> v0.8.1: minor release)
The respective note can be found here: https://getcomposer.org/doc/articles/versions.md#caret-version-range-
Of course, should we decide to bump the version to v1.x.x at some point, the semantic versioning rules you already expected will begin to apply.
2.: Yes, that's a bug. : ) Thank you for testing and reporting, a fix is in the works.
from xlsx-reader.
The just-released v0.10.1 contains a fix for the aforementioned issue regarding the usage of returnUnformatted with date/time configuration options.
from xlsx-reader.
Yeah, seems to work fine now, at least as far as our own automated tests are concerned. Thanks again!
from xlsx-reader.
Related Issues (17)
- Add XMLReader as a requirement HOT 1
- Reader incorrectly handles empty <row> elements HOT 2
- No option to return percentage values as unformatted fractional number HOT 7
- Error open XLS HOT 1
- Incompatible return type (Deprecated) HOT 2
- Enhancement to allow access to meta data read? HOT 1
- Is it possible to include an option to read a password protected file? HOT 1
- Please support number formats [$-F400] and [$-F800] HOT 1
- Tests throwing errors HOT 2
- libre office xlsx document overload HOT 1
- Error "P-1D" when reading an incorrect DateTime HOT 2
- Is there anyway to get the "value" from a cell (unformatted) HOT 2
- Problem handling Currency with Symbol £ English (United Kingdom) HOT 2
- Bug; multi-sectioned formats are exploded incorrectly... HOT 2
- how to disable remove repeat cell value? HOT 2
- Handling invalid row spans values? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xlsx-reader.