ExcelSplitter
Configuration file |
Optional properties file, see examples. Alternatively, a directory can be specified into which all Excel sheets with all rows are then extracted. |
Class name |
com.ebd.hub.datawizard.parser.ExcelSplitter |
Description
This preparer can extract Excel sheets as CSV files. Returns a list with lines in the following format.
<complete file path of CSV file>;<number of written rows>;<sheet name> |
Parameters
Parameter |
Description |
dir |
The target directory, see examples. |
sheet.include.names |
(optional) Explicit specification of the names of the sheets to be output. See examples. |
sheet.include.numbers |
(optional) Explicit specification of the numbers of the sheets to be output. See examples. |
sheet.exclude.names |
(optional) Explicit specification of the names of the sheets that are not to be output. See examples. |
sheet.exclude.numbers |
(optional) Explicit specification of the numbers of the sheets that are not to be output. See examples. |
skipHiddenRows |
(optional) If true, only visible rows of the sheets are output. Default: false. |
chunk.size |
(optional) The CSV files always contain a header line SheetName;<Name of sheet>. This is followed by chunk.size data lines before the header line is written again. The header line is not taken into account when calculating the chunk size. This can be used later in the parser to control the number of records (see also section TokenFileSplitter). Note: Only integers greater than 0 are taken into account. |
recalculate.formula |
(optional) If false, then formulas are not recalculated. This can be used if in exceptional cases the recalculation of complicated formulas does not work. Default: true. |
Examples
Example 1
dir=/excel-output/samples
sheet.include.names=Articles;Orders
sheet.include.numbers=3;9
skipHiddenRows=true
chunk.size=20000
Only visible rows of the sheets with the names Articles and Orders, as well as sheet 3 and 9 are written. Each CSV file contains the header after 20000 lines.
Example 2
dir=/excel-output/samples
sheet.exclude.names=Articles;Orders
sheet.exclude.numbers=3;9
skipHiddenRows=true
Only visible rows of all sheets that are not called Articles or Orders or that are not sheet 3 or 9 are written.
Example 3
If "exclude" and "include" are used together, "exclude" wins in the end if the definition does not apply to "include".
dir=/excel-output/samples
sheet.include.names=Articles;Orders
sheet.exclude.names=Articles;Orders
skipHiddenRows=true
Articles and Orders are written.
dir=/excel-output/samples
sheet.include.names=Articles;Orders
sheet.exclude.names=Shops
All sheets are written that are not named "Shops", as well as sheet "Articles" or "Orders".