StartsWithPatternInputFormatExcel is used to parse a Microsoft Excel file in which the beginning of each record is marked by a specific pattern defined using a regular expression.
Configuration
The configuration names consist of the following parameters:
- hgrid247.record.startPattern
Indicates the pattern that marks the start of a record.
- hgrid247.excel.sheet2process
Indicates which Excel sheet will be processed.
Default value: the first sheet.
To process all sheets, set the value to "all".
- hgrid247.excel.columndelimiter
Indicates the column delimiter used in the output.
Default value: comma (,).
- hgrid247.record.patternFlag
Indicates the pattern flag.
Default value: MULTILINE.
Multiple flags can be specified by separating them with |.
Example
Given the content of an Excel spreadsheet as shown below, records can be extracted based on a pattern.
To read records from the Excel spreadsheet, use the following configuration:
| Configuration Name | Configuration Value |
| hgrid247.excel.sheet2process | all |
| hgrid247.record.startPattern | ^\\d+, |
Output Result
The Excel file is parsed into the following records:
Record 1 :
1,name,MS Dhoni
,role,Captain
,position,Wicket-Keeper
,salary,9
Record 2 :
2,name,Shikhar Dhawan
,role,Batsman
,position,Point
,salary,10
Record 3 :
3,name,Virat Kohli
,role,Batsman
,position,cover
,salary,10
Record 4 :
4,name,Shami
,role,Bowler
,position,SquareLeg
,salary,12
Record 5 :
5,name,Zaheer Khan
,role,Bowler
,position,FineLeg
,salary,11
Behavior
- Detects the start of each record based on the configured regular expression
- Groups consecutive rows until the next start pattern is encountered
- Outputs each grouped block as a single record
- Supports parsing across multiple Excel sheets when configured
Typical Use Cases
- Parsing hierarchical or multi-line records stored in Excel files
- Processing Excel-based transaction or form-style data
- Grouping related Excel rows into logical records for ETL workflows