A Source that implements reading excel workbooks in xlsx format.
Modifiers | Name | Description |
---|---|---|
class |
XlsxSource.XslxSheetHandler |
Type | Name and description |
---|---|
java.lang.String |
dateFormat |
java.io.File |
excelFile |
groovy.lang.Closure<java.lang.Void> |
headerClosure |
java.lang.String |
password |
java.lang.String |
sheet |
java.io.InputStream |
stream |
Constructor and description |
---|
XlsxSource
(java.lang.String name, java.io.InputStream stream, java.lang.String sheet = null) Reads the given InputStream as an excel format file (xlsx), and processes the tabular data on the given sheet. |
XlsxSource
(java.io.File excelFile, java.lang.String sheet = null) Reads the given excelFile and pulls out all of the tabular data on the given sheet. |
Type Params | Return Type | Name and description |
---|---|---|
|
XlsxSource |
dateFormat(java.lang.String format) Sets the default format for dates (default format is yyyy-MM-dd). |
|
void |
doStart(Pipeline pipeline) |
|
XlsxSource |
header(groovy.lang.Closure<java.lang.Void> headerClosure) Attaches a closure that will be called back when the headers are available. |
|
XlsxSource |
password(java.lang.String password) The password to use for encrypted spreadsheets |
|
void |
setDateFormat(java.lang.String dateFormat) |
|
void |
setPassword(java.lang.String password) |
|
void |
setSheet(java.lang.String sheet) |
|
static XlsxSource |
xlsx(java.lang.String name, java.io.InputStream stream, java.lang.String sheet = null) Reads the given InputStream as an excel format file (xlsx), and processes the tabular data on the given sheet. |
|
static XlsxSource |
xlsx(java.io.File file, java.lang.String sheet = null ) Reads the given excelFile and pulls out all of the tabular data on the given sheet. |
Reads the given InputStream as an excel format file (xlsx), and processes the tabular data on the given sheet. If no sheet is provided it reads the first sheet of the workbook.
name
- The name of the underlying filestream
- The InputStream of the excel (xlsx) filesheet
- The name of the sheet to processReads the given excelFile and pulls out all of the tabular data on the given sheet. If not sheet is provided it will read the first sheet in the workbook.
excelFile
- The excel file to readsheet
- the name of the sheet to pull out, default is the first sheet.Sets the default format for dates (default format is yyyy-MM-dd). POI tends to return dates in Locale formats which aren't always convenient for working with so this sets the date format using the SimpleDateFormat syntax in Java.
format
- format string following the rules set out in SimpleDateFormatAttaches a closure that will be called back when the headers are available.
headerClosure
- the closure to call passing the headers as a java.util.ListThe password to use for encrypted spreadsheets
password
- the given password to use to decrypt the stylesheet.Reads the given InputStream as an excel format file (xlsx), and processes the tabular data on the given sheet. If no sheet is provided it reads the first sheet of the workbook.
name
- The name of the underlying filestream
- The InputStream of the excel (xlsx) filesheet
- The name of the sheet to processReads the given excelFile and pulls out all of the tabular data on the given sheet. If not sheet is provided it will read the first sheet in the workbook.
excelFile
- The excel file to readsheet
- the name of the sheet to pull out, default is the first sheet.Groovy Documentation