@@ -32,7 +32,7 @@ |
||
32 | 32 | // $inputFileType = 'Csv'; |
33 | 33 | $inputFileName = './sampleData/example1.xls'; |
34 | 34 | |
35 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
35 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
36 | 36 | $reader = IOFactory::createReader($inputFileType); |
37 | 37 | $spreadsheet = $reader->load($inputFileName); |
38 | 38 |
@@ -71,7 +71,7 @@ |
||
71 | 71 | /* Tell the Reader that we want to use the Read Filter that we've Instantiated **/ |
72 | 72 | /* and that we want to store it in contiguous rows/columns **/ |
73 | 73 | $reader->setReadFilter($chunkFilter) |
74 | - ->setContiguous(true); |
|
74 | + ->setContiguous(true); |
|
75 | 75 | |
76 | 76 | /* Instantiate a new PhpSpreadsheet object manually **/ |
77 | 77 | $spreadsheet = new Spreadsheet(); |
@@ -57,7 +57,7 @@ |
||
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
60 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
61 | 61 | /* Create a new Reader of the type defined in $inputFileType **/ |
62 | 62 | $reader = IOFactory::createReader($inputFileType); |
63 | 63 |
@@ -31,18 +31,18 @@ |
||
31 | 31 | $inputFileName = './sampleData/example1.xls'; |
32 | 32 | $sheetname = 'Data Sheet #2'; |
33 | 33 | |
34 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
34 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
35 | 35 | $reader = IOFactory::createReader($inputFileType); |
36 | -echo 'Loading Sheet "',$sheetname,'" only<br />'; |
|
36 | +echo 'Loading Sheet "', $sheetname, '" only<br />'; |
|
37 | 37 | $reader->setLoadSheetsOnly($sheetname); |
38 | 38 | $spreadsheet = $reader->load($inputFileName); |
39 | 39 | |
40 | 40 | echo '<hr />'; |
41 | 41 | |
42 | -echo $spreadsheet->getSheetCount(),' worksheet',(($spreadsheet->getSheetCount() == 1) ? '' : 's'),' loaded<br /><br />'; |
|
42 | +echo $spreadsheet->getSheetCount(), ' worksheet', (($spreadsheet->getSheetCount() == 1) ? '' : 's'), ' loaded<br /><br />'; |
|
43 | 43 | $loadedSheetNames = $spreadsheet->getSheetNames(); |
44 | 44 | foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) { |
45 | - echo $sheetIndex,' -> ',$loadedSheetName,'<br />'; |
|
45 | + echo $sheetIndex, ' -> ', $loadedSheetName, '<br />'; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | ?> |
@@ -26,9 +26,9 @@ |
||
26 | 26 | $inputFileName = './sampleData/example1.xls'; |
27 | 27 | |
28 | 28 | $inputFileType = IOFactory::identify($inputFileName); |
29 | -echo 'File ',pathinfo($inputFileName, PATHINFO_BASENAME),' has been identified as an ',$inputFileType,' file<br />'; |
|
29 | +echo 'File ', pathinfo($inputFileName, PATHINFO_BASENAME), ' has been identified as an ', $inputFileType, ' file<br />'; |
|
30 | 30 | |
31 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with the identified reader type<br />'; |
|
31 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' using IOFactory with the identified reader type<br />'; |
|
32 | 32 | $reader = IOFactory::createReader($inputFileType); |
33 | 33 | $spreadsheet = $reader->load($inputFileName); |
34 | 34 |
@@ -28,11 +28,11 @@ |
||
28 | 28 | |
29 | 29 | $reader = IOFactory::createReader($inputFileType); |
30 | 30 | $inputFileName = array_shift($inputFileNames); |
31 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' into WorkSheet #1 using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
31 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' into WorkSheet #1 using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
32 | 32 | $spreadsheet = $reader->load($inputFileName); |
33 | 33 | $spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); |
34 | 34 | foreach ($inputFileNames as $sheet => $inputFileName) { |
35 | - echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' into WorkSheet #',($sheet + 2),' using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
35 | + echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' into WorkSheet #', ($sheet + 2), ' using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
36 | 36 | $reader->setSheetIndex($sheet + 1); |
37 | 37 | $reader->loadIntoExisting($inputFileName, $spreadsheet); |
38 | 38 | $spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
63 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
63 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
64 | 64 | /* Create a new Reader of the type defined in $inputFileType **/ |
65 | 65 | $reader = IOFactory::createReader($inputFileType); |
66 | 66 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | /* Loop to read our worksheet in "chunk size" blocks **/ |
73 | 73 | for ($startRow = 2; $startRow <= 240; $startRow += $chunkSize) { |
74 | - echo 'Loading WorkSheet using configurable filter for headings row 1 and for rows ',$startRow,' to ',($startRow + $chunkSize - 1),'<br />'; |
|
74 | + echo 'Loading WorkSheet using configurable filter for headings row 1 and for rows ', $startRow, ' to ', ($startRow + $chunkSize - 1), '<br />'; |
|
75 | 75 | /* Create a new Instance of our Read Filter, passing in the limits on which rows we want to read **/ |
76 | 76 | $chunkFilter = new chunkReadFilter($startRow, $chunkSize); |
77 | 77 | /* Tell the Reader that we want to use the new Read Filter that we've just Instantiated **/ |
@@ -29,17 +29,17 @@ |
||
29 | 29 | $inputFileName = './sampleData/example1.tsv'; |
30 | 30 | |
31 | 31 | $reader = IOFactory::createReader($inputFileType); |
32 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' into WorkSheet #1 using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
32 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' into WorkSheet #1 using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
33 | 33 | $reader->setDelimiter("\t"); |
34 | 34 | $spreadsheet = $reader->load($inputFileName); |
35 | 35 | $spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); |
36 | 36 | |
37 | 37 | echo '<hr />'; |
38 | 38 | |
39 | -echo $spreadsheet->getSheetCount(),' worksheet',(($spreadsheet->getSheetCount() == 1) ? '' : 's'),' loaded<br /><br />'; |
|
39 | +echo $spreadsheet->getSheetCount(), ' worksheet', (($spreadsheet->getSheetCount() == 1) ? '' : 's'), ' loaded<br /><br />'; |
|
40 | 40 | $loadedSheetNames = $spreadsheet->getSheetNames(); |
41 | 41 | foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) { |
42 | - echo '<b>Worksheet #',$sheetIndex,' -> ',$loadedSheetName,' (Formatted)</b><br />'; |
|
42 | + echo '<b>Worksheet #', $sheetIndex, ' -> ', $loadedSheetName, ' (Formatted)</b><br />'; |
|
43 | 43 | $spreadsheet->setActiveSheetIndexByName($loadedSheetName); |
44 | 44 | $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); |
45 | 45 | var_dump($sheetData); |
@@ -30,16 +30,16 @@ |
||
30 | 30 | // $inputFileType = 'Gnumeric'; |
31 | 31 | $inputFileName = './sampleData/example1.xls'; |
32 | 32 | |
33 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
33 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
34 | 34 | $reader = IOFactory::createReader($inputFileType); |
35 | 35 | |
36 | 36 | /* Read the list of Worksheet Names from the Workbook file **/ |
37 | 37 | echo 'Read the list of Worksheets in the WorkBook<br />'; |
38 | 38 | $worksheetNames = $reader->listWorksheetNames($inputFileName); |
39 | 39 | |
40 | -echo 'There are ',count($worksheetNames),' worksheet',((count($worksheetNames) == 1) ? '' : 's'),' in the workbook<br /><br />'; |
|
40 | +echo 'There are ', count($worksheetNames), ' worksheet', ((count($worksheetNames) == 1) ? '' : 's'), ' in the workbook<br /><br />'; |
|
41 | 41 | foreach ($worksheetNames as $worksheetName) { |
42 | - echo $worksheetName,'<br />'; |
|
42 | + echo $worksheetName, '<br />'; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | ?> |
@@ -30,7 +30,7 @@ |
||
30 | 30 | // $inputFileType = 'Gnumeric'; |
31 | 31 | $inputFileName = './sampleData/example1.xls'; |
32 | 32 | |
33 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' information using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
33 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' information using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
34 | 34 | |
35 | 35 | $reader = IOFactory::createReader($inputFileType); |
36 | 36 | $worksheetData = $reader->listWorksheetInfo($inputFileName); |