-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
35 lines (27 loc) · 1.02 KB
/
index.php
File metadata and controls
35 lines (27 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
ini_set('display_errors',1);
ini_set('display_startup_erros',1);
error_reporting(E_ALL);
include 'PHPExcel_1.8.0_doc/Classes/PHPExcel.php';
include 'PHPExcel_1.8.0_doc/Classes/PHPExcel/IOFactory.php' ;
/*$objReader = PHPExcel_IOFactory::createReader('Excel2007');
$objReader->setReadDataOnly(true);
$objPHPExcel = $objReader->load("LOJAS.xlsx");*/
$inputFileName='LOJAS1.csv';
$inputFileType = PHPExcel_IOFactory::identify($inputFileName);
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
if($inputFileType=='CSV'){
$objReader->setDelimiter(';');
}
$objPHPExcel = $objReader->load($inputFileName);
$objWorksheet = $objPHPExcel->getActiveSheet();
$highestRow = $objWorksheet->getHighestRow();
$highestColumn = $objWorksheet->getHighestColumn();
/*$highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn);
*/
for ($row =2; $row < $highestRow; $row++) {
$loja = $objPHPExcel-> getActiveSheet() -> getCellByColumnAndRow(0, $row) -> getValue();
echo "Loja:".$loja."<br>";
}
echo $highestRow;
?>