class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_Reader_IReader

PHPExcelReaderCSV

Copyright (c) 2006 - 2015 PHPExcel

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Methods

boolean
getReadDataOnly()

Read data only? If this is true, then the Reader will only read data values for cells, it will not read any formatting information.

setReadDataOnly(boolean $pValue = false)

Set read data only Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information.

boolean
getReadEmptyCells()

Read empty cells? If this is true (the default), then the Reader will read data values for all cells, irrespective of value.

setReadEmptyCells(boolean $pValue = true)

Set read empty cells Set to true (the default) to advise the Reader read data values for all cells, irrespective of value.

boolean
getIncludeCharts()

Read charts in workbook? If this is true, then the Reader will include any charts that exist in the workbook.

setIncludeCharts(boolean $pValue = false)

Set read charts in workbook Set to true, to advise the Reader to include any charts that exist in the workbook.

mixed
getLoadSheetsOnly()

Get which sheets to load Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null indicating that all worksheets in the workbook should be loaded.

setLoadSheetsOnly(mixed $value = null)

Set which sheets to load

setLoadAllSheets()

Set all sheets to load Tells the Reader to load all worksheets from the workbook.

boolean
canRead(string $pFilename)

Can the current PHPExcelReaderIReader read the file?

securityScan(string $xml)

Scan theXML for use of <!ENTITY to prevent XXE/XEE attacks

securityScanFile(string $filestream)

Scan theXML for use of <!ENTITY to prevent XXE/XEE attacks

__construct()

Create a new PHPExcelReaderCSV

setInputEncoding(string $pValue = 'UTF-8')

Set input encoding

string
getInputEncoding()

Get input encoding

listWorksheetInfo(string $pFilename)

Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns)

load(string $pFilename)

Loads PHPExcel from file

loadIntoExisting(string $pFilename, PHPExcel $objPHPExcel)

Loads PHPExcel from file into PHPExcel instance

string
getDelimiter()

Get delimiter

setDelimiter(string $pValue = ',')

Set delimiter

string
getEnclosure()

Get enclosure

setEnclosure(string $pValue = '"')

Set enclosure

integer
getSheetIndex()

Get sheet index

setSheetIndex(integer $pValue)

Set sheet index

setContiguous(boolean $contiguous = false)

Set Contiguous

boolean
getContiguous()

Get Contiguous

Details

boolean getReadDataOnly()

Read data only? If this is true, then the Reader will only read data values for cells, it will not read any formatting information.

If false (the default) it will read data and formatting.

Return Value

boolean

PHPExcel_Reader_IReader setReadDataOnly(boolean $pValue = false)

Set read data only Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information.

Set to false (the default) to advise the Reader to read both data and formatting for cells.

Parameters

boolean $pValue

Return Value

PHPExcel_Reader_IReader

boolean getReadEmptyCells()

Read empty cells? If this is true (the default), then the Reader will read data values for all cells, irrespective of value.

If false it will not read data for cells containing a null value or an empty string.

Return Value

boolean

PHPExcel_Reader_IReader setReadEmptyCells(boolean $pValue = true)

Set read empty cells Set to true (the default) to advise the Reader read data values for all cells, irrespective of value.

Set to false to advise the Reader to ignore cells containing a null value or an empty string.

Parameters

boolean $pValue

Return Value

PHPExcel_Reader_IReader

boolean getIncludeCharts()

Read charts in workbook? If this is true, then the Reader will include any charts that exist in the workbook.

Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value. If false (the default) it will ignore any charts defined in the workbook file.

Return Value

boolean

PHPExcel_Reader_IReader setIncludeCharts(boolean $pValue = false)

Set read charts in workbook Set to true, to advise the Reader to include any charts that exist in the workbook.

Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value. Set to false (the default) to discard charts.

Parameters

boolean $pValue

Return Value

PHPExcel_Reader_IReader

mixed getLoadSheetsOnly()

Get which sheets to load Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null indicating that all worksheets in the workbook should be loaded.

Return Value

mixed

PHPExcel_Reader_IReader setLoadSheetsOnly(mixed $value = null)

Set which sheets to load

Parameters

mixed $value This should be either an array of worksheet names to be loaded, or a string containing a single worksheet name. If NULL, then it tells the Reader to read all worksheets in the workbook

Return Value

PHPExcel_Reader_IReader

PHPExcel_Reader_IReader setLoadAllSheets()

Set all sheets to load Tells the Reader to load all worksheets from the workbook.

PHPExcel_Reader_IReadFilter getReadFilter()

Read filter

PHPExcel_Reader_IReader setReadFilter(PHPExcel_Reader_IReadFilter $pValue)

Set read filter

Parameters

PHPExcel_Reader_IReadFilter $pValue

Return Value

PHPExcel_Reader_IReader

boolean canRead(string $pFilename)

Can the current PHPExcelReaderIReader read the file?

Parameters

string $pFilename

Return Value

boolean

Exceptions

PHPExcel_Reader_Exception

securityScan(string $xml)

Scan theXML for use of <!ENTITY to prevent XXE/XEE attacks

Parameters

string $xml

Exceptions

PHPExcel_Reader_Exception

securityScanFile(string $filestream)

Scan theXML for use of <!ENTITY to prevent XXE/XEE attacks

Parameters

string $filestream

Exceptions

PHPExcel_Reader_Exception

at line 110
__construct()

Create a new PHPExcelReaderCSV

at line 130
setInputEncoding(string $pValue = 'UTF-8')

Set input encoding

Parameters

string $pValue Input encoding

at line 141
string getInputEncoding()

Get input encoding

Return Value

string

at line 204
listWorksheetInfo(string $pFilename)

Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns)

Parameters

string $pFilename

Exceptions

PHPExcel_Reader_Exception

at line 249
PHPExcel load(string $pFilename)

Loads PHPExcel from file

Parameters

string $pFilename

Return Value

PHPExcel

Exceptions

PHPExcel_Reader_Exception

at line 266
PHPExcel loadIntoExisting(string $pFilename, PHPExcel $objPHPExcel)

Loads PHPExcel from file into PHPExcel instance

Parameters

string $pFilename
PHPExcel $objPHPExcel

Return Value

PHPExcel

Exceptions

PHPExcel_Reader_Exception

at line 338
string getDelimiter()

Get delimiter

Return Value

string

at line 349
PHPExcel_Reader_CSV setDelimiter(string $pValue = ',')

Set delimiter

Parameters

string $pValue Delimiter, defaults to ,

Return Value

PHPExcel_Reader_CSV

at line 360
string getEnclosure()

Get enclosure

Return Value

string

at line 371
PHPExcel_Reader_CSV setEnclosure(string $pValue = '"')

Set enclosure

Parameters

string $pValue Enclosure, defaults to "

Return Value

PHPExcel_Reader_CSV

at line 385
integer getSheetIndex()

Get sheet index

Return Value

integer

at line 396
PHPExcel_Reader_CSV setSheetIndex(integer $pValue)

Set sheet index

Parameters

integer $pValue Sheet index

Return Value

PHPExcel_Reader_CSV

at line 407
setContiguous(boolean $contiguous = false)

Set Contiguous

Parameters

boolean $contiguous

at line 422
boolean getContiguous()

Get Contiguous

Return Value

boolean