PHPExcel classes » \PHPExcel_Reader_CSV

PHPExcel_Reader_CSV

category | PHPExcel
package | PHPExcel_Reader
copyright | Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)

### Methods

## Create a new PHPExcel_Reader_CSV

    __construct()

## Can the current PHPExcel_Reader_IReader read the file?

    canRead(string $pFilename) : boolean

Inherited

inherited_from | \PHPExcel_Reader_IReader::canRead()

### Parameters

#### $pFilename

`string`

### Exceptions

`\PHPExcel_Reader_Exception` |

### Returns

`boolean`

## Get Contiguous

    getContiguous() : boolean

### Returns

`boolean`

## Get delimiter

    getDelimiter() : string

### Returns

`string`

## Get enclosure

    getEnclosure() : string

### Returns

`string`

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

    getIncludeCharts() : boolean

Inherited

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.

inherited_from | \PHPExcel_Reader_Abstract::getIncludeCharts()

### Returns

`boolean`

## Get input encoding

    getInputEncoding() : string

### Returns

`string`

## Get line ending

    getLineEnding() : string

### Returns

`string`

## 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.

    getLoadSheetsOnly() : mixed

Inherited

inherited_from | \PHPExcel_Reader_Abstract::getLoadSheetsOnly()

### Returns

`mixed`

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

    getReadDataOnly() : boolean

Inherited

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

inherited_from | \PHPExcel_Reader_Abstract::getReadDataOnly()

### Returns

`boolean`

## Read filter

    getReadFilter() : \PHPExcel_Reader_IReadFilter

Inherited

inherited_from | \PHPExcel_Reader_Abstract::getReadFilter()

### Returns

`\PHPExcel_Reader_IReadFilter`

## Get sheet index

    getSheetIndex() : integer

### Returns

`integer`

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

    listWorksheetInfo(string $pFilename)

### Parameters

#### $pFilename

`string`

### Exceptions

`\PHPExcel_Reader_Exception` |

## Loads PHPExcel from file

    load(string $pFilename) : \PHPExcel

### Parameters

#### $pFilename

`string`

### Exceptions

`\PHPExcel_Reader_Exception` |

### Returns

`\PHPExcel`

## Loads PHPExcel from file into PHPExcel instance

    loadIntoExisting(string $pFilename, \PHPExcel $objPHPExcel) : \PHPExcel

### Parameters

#### $pFilename

`string`

#### $objPHPExcel

`\PHPExcel`

### Exceptions

`\PHPExcel_Reader_Exception` |

### Returns

`\PHPExcel`

## Set Contiguous

    setContiguous(boolean $contiguous)

### Parameters

#### $contiguous

`boolean`

## Set delimiter

    setDelimiter(string $pValue) : \PHPExcel_Reader_CSV

### Parameters

#### $pValue

`string`

Delimiter, defaults to ,

### Returns

`\PHPExcel_Reader_CSV`

## Set enclosure

    setEnclosure(string $pValue) : \PHPExcel_Reader_CSV

### Parameters

#### $pValue

`string`

Enclosure, defaults to "

### Returns

`\PHPExcel_Reader_CSV`

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

    setIncludeCharts(boolean $pValue) : \PHPExcel_Reader_IReader

Inherited

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.

inherited_from | \PHPExcel_Reader_Abstract::setIncludeCharts()

### Parameters

#### $pValue

`boolean`

### Returns

`\PHPExcel_Reader_IReader`

## Set input encoding

    setInputEncoding(string $pValue)

### Parameters

#### $pValue

`string`

Input encoding

## Set line ending

    setLineEnding(string $pValue) : \PHPExcel_Reader_CSV

### Parameters

#### $pValue

`string`

Line ending, defaults to OS line ending (PHP_EOL)

### Returns

`\PHPExcel_Reader_CSV`

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

    setLoadAllSheets() : \PHPExcel_Reader_IReader

Inherited

inherited_from | \PHPExcel_Reader_Abstract::setLoadAllSheets()

### Returns

`\PHPExcel_Reader_IReader`

## Set which sheets to load

    setLoadSheetsOnly(mixed $value) : \PHPExcel_Reader_IReader

Inherited

inherited_from | \PHPExcel_Reader_Abstract::setLoadSheetsOnly()

### Parameters

#### $value

`mixed`

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

### Returns

`\PHPExcel_Reader_IReader`

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

    setReadDataOnly(boolean $pValue) : \PHPExcel_Reader_IReader

Inherited

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

inherited_from | \PHPExcel_Reader_Abstract::setReadDataOnly()

### Parameters

#### $pValue

`boolean`

### Returns

`\PHPExcel_Reader_IReader`

## Set read filter

    setReadFilter(\PHPExcel_Reader_IReadFilter $pValue) : \PHPExcel_Reader_IReader

Inherited

inherited_from | \PHPExcel_Reader_Abstract::setReadFilter()

### Parameters

#### $pValue

`\PHPExcel_Reader_IReadFilter`

### Returns

`\PHPExcel_Reader_IReader`

## Set sheet index

    setSheetIndex(integer $pValue) : \PHPExcel_Reader_CSV

### Parameters

#### $pValue

`integer`

Sheet index

### Returns

`\PHPExcel_Reader_CSV`

## Validate that the current file is a CSV file

    _isValidFormat() : boolean

### Returns

`boolean`

## Open file for reading

    _openFile(string $pFilename) : resource

Inherited

inherited_from | \PHPExcel_Reader_Abstract::_openFile()

### Parameters

#### $pFilename

`string`

### Exceptions

`\PHPExcel_Reader_Exception` |

### Returns

`resource`

## Move filepointer past any BOM marker

    _skipBOM()

### Properties

##

    $_fileHandle

Inherited

inherited_from | \PHPExcel_Reader_Abstract::$$_fileHandle

##

    $_includeCharts : boolean

Inherited

inherited_from | \PHPExcel_Reader_Abstract::$$_includeCharts

##

    $_loadSheetsOnly : array

Inherited

If null, then all worksheets will be loaded.

inherited_from | \PHPExcel_Reader_Abstract::$$_loadSheetsOnly

##

    $_readDataOnly : boolean

Inherited

inherited_from | \PHPExcel_Reader_Abstract::$$_readDataOnly

##

    $_readFilter : \PHPExcel_Reader_IReadFilter

Inherited

inherited_from | \PHPExcel_Reader_Abstract::$$_readFilter

##

    $_contiguous : int

access | private

##

    $_contiguousRow : int

##

    $_delimiter : string

access | private

##

    $_enclosure : string

access | private

##

    $_inputEncoding : string

access | private

##

    $_lineEnding : string

access | private

##

    $_sheetIndex : int

access | private