Comments (10)
My first post was kinda vague, i will explain more:
$xlsx = SimpleXLSX::parse($_SERVER['DOCUMENT_ROOT'].'/application/third_party/testing.xlsx');
$sheet = $this->input->get('sheetname', TRUE);
$sheetNames = $xlsx->sheetNames();
echo '<ul>';
foreach ( $sheetNames as $sheetKey => $sheetName )
{
echo '<li>';
echo anchor('test/simple/?sheetname='.$sheetKey, $sheetName);
echo '</li>';
}
echo '</ul>';
if(empty($sheet))
{
$sheet = 0;
}
list( $num_cols, $num_rows ) = $xlsx->dimension($sheet);
var_dump($xlsx->dimension_no_empty());
echo '<h2>'.$xlsx->sheetName($sheet).' - Total Rows: '.$num_rows.'</h2>';
echo '<table border=1>';
foreach ( $xlsx->rows( $sheet ) as $r ) {
echo '<tr>';
for ( $i = 0; $i < $num_cols; $i ++ ) {
echo '<td>' . ( ! empty( $r[ $i ] ) ? $r[ $i ] : ' ' ) . '</td>';
}
echo '</tr>';
}
echo '</table>';
I have a total of 543 entries, but when i do echo $num_rows i get 3716 (3173 rows are empty).
from simplexlsx.
don't trust dimension() - there values from XML, use $rows = $xlsx->rows(); echo count( $rows );
from simplexlsx.
Well, doesn't work, same effect as dimension()
$rows = $xlsx->rows($sheet);
echo '<h2>'.$xlsx->sheetName($sheet).' - Total Rows: '.count( $rows ).'</h2>';
from simplexlsx.
Understood
Check it, I think there 1 cell in 3716 row is not empty....
from simplexlsx.
I did check not even a whitespace, can i email you the spreadsheet so you can see it?
from simplexlsx.
pls, send to [email protected]
from simplexlsx.
Done!
from simplexlsx.
I also applied your latest update with:
$dim = $xlsx->dimension($sheet); // don't trust dimension extracted from xml
$num_cols = $dim[0];
$num_rows = $dim[1];
from simplexlsx.
there was empty styled cells
from simplexlsx.
Download 0.8.8 or composer update
added skip_empty_rows param in ::parse
$xlsx = SimpleXLSX::parse($_SERVER['DOCUMENT_ROOT'].'/application/third_party/testing.xlsx', false, false, true);
from simplexlsx.
Related Issues (20)
- False dimension? HOT 3
- phpcs error HOT 1
- 503 error when uploading a 4 mb excel file HOT 5
- Sorry i create Issue here (DocxTemplate) HOT 1
- Undefined index: fontId HOT 2
- Hidden Sheets HOT 1
- Pivot Table
- Undefined index: alignment HOT 2
- date parse error HOT 2
- Unknown archive format HOT 2
- File with LF instead of CRLF won't parse HOT 7
- Read Rows by Limit, offset HOT 1
- readRowsEx limit arg HOT 1
- Don't parse all numbers using `if ( is_numeric( ... ) )` HOT 4
- Can't use Composer to install
- Html tags deleted when writing in Cell HOT 1
- Need help getting each cell value for every row HOT 1
- Increasing memory usage HOT 3
- If the string in a cell contains a half-width English comma, it will be split into two cells. HOT 2
- The 'activeSheet' value is not set HOT 1
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 simplexlsx.