ConvertExcelToCSVProcessor

Deprecation notice:

ConvertExcelToCSVProcessor is no longer needed since there is now the ExcelReader which along with CSVRecordSetWriter can be used in ConvertRecord to achieve the same thing.

Please consider using one the following alternatives: ExcelReader,CSVRecordSetWriter,ConvertRecord

Description:

Consumes a Microsoft Excel document and converts each worksheet to csv. Each sheet from the incoming Excel document will generate a new Flowfile that will be output from this processor. Each output Flowfile's contents will be formatted as a csv file where the each row from the excel sheet is output as a newline in the csv file. This processor is currently only capable of processing .xlsx (XSSF 2007 OOXML file format) Excel documents and not older .xls (HSSF '97(-2007) file format) documents. This processor also expects well formatted CSV content and will not escape cell's containing invalid content such as newlines or additional commas.

Additional Details...

Tags:

excel, csv, poi

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Sheets to Extractextract-sheetsComma separated list of Excel document sheet names that should be extracted from the excel document. If this property is left blank then all of the sheets will be extracted from the Excel document. The list of names is case in-sensitive. Any sheets not specified in this value will be ignored. A bulletin will be generated if a specified sheet(s) are not found.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Number of Rows to Skipexcel-extract-first-row0The row number of the first row to start processing.Use this to skip over rows of data at the top of your worksheet that are not part of the dataset.Empty rows of data anywhere in the spreadsheet will always be skipped, no matter what this value is set to.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Columns To Skipexcel-extract-column-to-skipComma delimited list of column numbers to skip. Use the columns number and not the letter designation. Use this to skip over columns anywhere in your worksheet that you don't want extracted as part of the record.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Format Cell Valuesexcel-format-valuesfalse
  • true
  • false
Should the cell values be written to CSV using the formatting applied in Excel, or should they be printed as raw values.
Format Booleansexcel-format-booleanstrue
  • true
  • false
If true, true/false will be represented by TRUE/FALSE. If false, true/false will be represented by 0/1.
CSV FormatCSV FormatCustom Format
  • Custom Format The format of the CSV is configured by using the properties of this Controller Service, such as Value Separator
  • RFC 4180 CSV data follows the RFC 4180 Specification defined at https://tools.ietf.org/html/rfc4180
  • Microsoft Excel CSV data follows the format used by Microsoft Excel
  • Tab-Delimited CSV data is Tab-Delimited instead of Comma Delimited
  • MySQL Format CSV data follows the format used by MySQL
  • Informix Unload The format used by Informix when issuing the UNLOAD TO file_name command
  • Informix Unload Escape Disabled The format used by Informix when issuing the UNLOAD TO file_name command with escaping disabled
Specifies which "format" the CSV data is in, or specifies if custom formatting should be used.
Value SeparatorValue Separator,The character that is used to separate values/fields in a CSV Record. If the property has been specified via Expression Language but the expression gets evaluated to an invalid Value Separator at runtime, then it will be skipped and the default Value Separator will be used.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)

This Property is only considered if the [CSV Format] Property has a value of "Custom Format".
Include Header LineInclude Header Linetrue
  • true
  • false
Specifies whether or not the CSV column names should be written out as the first line.
Quote CharacterQuote Character"The character that is used to quote values so that escape characters do not have to be used. If the property has been specified via Expression Language but the expression gets evaluated to an invalid Quote Character at runtime, then it will be skipped and the default Quote Character will be used.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)

This Property is only considered if the [CSV Format] Property has a value of "Custom Format".
Escape CharacterEscape Character\The character that is used to escape characters that would otherwise have a specific meaning to the CSV Parser. If the property has been specified via Expression Language but the expression gets evaluated to an invalid Escape Character at runtime, then it will be skipped and the default Escape Character will be used. Setting it to an empty string means no escape character should be used.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)

This Property is only considered if the [CSV Format] Property has a value of "Custom Format".
Comment MarkerComment MarkerThe character that is used to denote the start of a comment. Any line that begins with this comment will be ignored.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)

This Property is only considered if the [CSV Format] Property has a value of "Custom Format".
Null StringNull StringSpecifies a String that, if present as a value in the CSV, should be considered a null field instead of using the literal value.

This Property is only considered if the [CSV Format] Property has a value of "Custom Format".
Trim FieldsTrim Fieldstrue
  • true
  • false
Whether or not white space should be removed from the beginning and end of fields

This Property is only considered if the [CSV Format] Property has a value of "Custom Format".
Quote ModeQuote ModeDo Not Quote Values
  • Quote All Values All values will be quoted using the configured quote character.
  • Quote Minimal Values will be quoted only if they are contain special characters such as newline characters or field separators.
  • Quote Non-Numeric Values Values will be quoted unless the value is a number.
  • Do Not Quote Values Values will not be quoted. Instead, all special characters will be escaped using the configured escape character.
Specifies how fields should be quoted when they are written

This Property is only considered if the [CSV Format] Property has a value of "Custom Format".
Record SeparatorRecord Separator\nSpecifies the characters to use in order to separate CSV Records

This Property is only considered if the [CSV Format] Property has a value of "Custom Format".
Include Trailing DelimiterInclude Trailing Delimiterfalse
  • true
  • false
If true, a trailing delimiter will be added to each CSV Record that is written. If false, the trailing delimiter will be omitted.

This Property is only considered if the [CSV Format] Property has a value of "Custom Format".

Relationships:

NameDescription
originalOriginal Excel document received by this processor
successExcel data converted to csv
failureFailed to parse the Excel document

Reads Attributes:

None specified.

Writes Attributes:

NameDescription
sheetnameThe name of the Excel sheet that this particular row of data came from in the Excel document
numrowsThe number of rows in this Excel Sheet
sourcefilenameThe name of the Excel document file that this data originated from
convertexceltocsvprocessor.errorError message that was encountered on a per Excel sheet basis. This attribute is only populated if an error was occured while processing the particular sheet. Having the error present at the sheet level will allow for the end user to better understand what syntax errors in their excel doc on a larger scale caused the error.

State management:

This component does not store state.

Restricted:

This component is not restricted.

System Resource Considerations:

None specified.