readExcel
Reads an Excel sheet to DataFrame.
Note that if input dataframe contains duplicate column names, they will be automatically renamed in the resulting DataFrame.
When packaging an application as a fat JAR, merge META-INF/services resources so Apache POI can discover all Excel format providers. See Packaging into a fat JAR on the documentation website.
Parameters
sheet to read. By default, the first sheet in the document
comma separated list of Excel column letters and column ranges (e.g. “A:E” or “A,C,E:F”)
range of columns to read as String regardless of a cell type. For example, by default numeric cell with value "3" will be parsed as Double with value being 3.0. With this option, it will be simply "3"
number of rows before header
number of rows to read.
when set to true, it will take the first row (after skipRows) as the header. when set to false, it operates as NameRepairStrategy.MAKE_UNIQUE, ensuring unique column names will make the columns be named according to excel columns, like "A", "B", "C" etc. for unstructured data.
when set to true, empty strings in cells are parsed as null (default true). These cells are ignored when inferring the column’s type.
Reads an Excel sheet to DataFrame.
Note that if input dataframe contains duplicate column names, they will be automatically renamed in the resulting DataFrame.
Parameters
sheet to read. By default, the first sheet in the document
comma separated list of Excel column letters and column ranges (e.g. “A:E” or “A,C,E:F”)
range of columns to read as String regardless of a cell type. For example, by default numeric cell with value "3" will be parsed as Double with value being 3.0. With this option, it will be simply "3" See also FormattingOptions.formatter and DataFormatter.formatCellValue.
number of rows before header
number of rows to read.
when set to true, it will take the first row (after skipRows) as the header. when set to false, it operates as NameRepairStrategy.MAKE_UNIQUE, ensuring unique column names will make the columns be named according to excel columns, like "A", "B", "C" etc. for unstructured data.
when set to true, empty strings in cells are parsed as null (default true). These cells are ignored when inferring the column’s type.
Reads an Excel sheet to DataFrame.
Note that if input dataframe contains duplicate column names, they will be automatically renamed in the resulting DataFrame.
Parameters
sheet to read.
comma separated list of Excel column letters and column ranges (e.g. “A:E” or “A,C,E:F”)
range of columns to read as String regardless of a cell's type. For example, by default numeric cell with value "3" will be parsed as Double with value being 3.0. With this option, it will be simply "3" See also FormattingOptions.formatter and DataFormatter.formatCellValue.
number of rows before header
number of rows to read.
when set to true, it will take the first row (after skipRows) as the header. when set to false, it operates as NameRepairStrategy.MAKE_UNIQUE, ensuring unique column names will make the columns be named according to excel columns, like "A", "B", "C" etc. for unstructured data.
Deprecated
NameRepairStrategy is deprecated. Name repair is now always applied via ColumnNameGenerator, consistent with other IO readers. Will be ERROR in 1.1.