ConvertExcelToCSVProcessor - EL support for rows and columns to skip
This closes
@@ -108,6 +108,7 @@ public class ConvertExcelToCSVProcessor
+ "Empty rows of data anywhere in the spreadsheet will always be skipped, no matter what this value is set to.")
.required(true)
.defaultValue("0")
+ .expressionLanguageSupported(true)
.addValidator(StandardValidators.NON_NEGATIVE_INTEGER_VALIDATOR)
.build();
@@ -117,6 +118,7 @@ public class ConvertExcelToCSVProcessor
.description("Comma 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.")
.required(false)
+ .expressionLanguageSupported(true)
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
.build();
@@ -196,15 +198,15 @@ public class ConvertExcelToCSVProcessor
return;
}
- final String desiredSheetsDelimited = context.getProperty(DESIRED_SHEETS).evaluateAttributeExpressions().getValue();
+ final String desiredSheetsDelimited = context.getProperty(DESIRED_SHEETS).evaluateAttributeExpressions(flowFile).getValue();
final boolean formatValues = context.getProperty(FORMAT_VALUES).asBoolean();
final CSVFormat csvFormat = CSVUtils.createCSVFormat(context);
//Switch to 0 based index
- final int firstRow = context.getProperty(ROWS_TO_SKIP).asInteger() - 1;
+ final int firstRow = context.getProperty(ROWS_TO_SKIP).evaluateAttributeExpressions(flowFile).asInteger() - 1;
final String[] sColumnsToSkip = StringUtils
- .split(context.getProperty(COLUMNS_TO_SKIP).getValue(), ",");
+ .split(context.getProperty(COLUMNS_TO_SKIP).evaluateAttributeExpressions(flowFile).getValue(), ",");
final List<Integer> columnsToSkip = new ArrayList<>();
