Excel parsing
The Excel parsing operator parses selected Excel files, extracts information such as text and images, and generates Markdown files. If a file is in the .xls format, the operator first converts it to the .xlsx format before parsing. This topic describes how to configure the Excel parsing operator.
Prerequisites
-
To use the workflow feature, you must first purchase the unstructured data feature for the instance.
-
You have created a workflow. For more information, see Create and manage a workflow.
Limitations
Currently, the operator can parse only the first 10,000 rows of data.
Permissions
In a Basic project, project administrators, developers, analysts, and custom project roles with the Dataset-Use permission can use any dataset in the project as an input or output for the operator.
Supported file formats
The Excel parsing operator supports the following file formats: .xls and .xlsx.
Procedure
-
On the Dataphin homepage, choose Development > Data Development from the top navigation bar.
-
On the Development page, select a project from the top navigation bar.
-
In the left-side navigation pane, choose Data Processing > Workflow. From the Workflow list, click the target workflow to open its canvas. From the operator library on the left, drag the Excel parsing operator to the canvas. In the Excel parsing panel on the right, configure the following parameters.
Parameter
Description
Step name
Enter a name for the current operator. The name can contain any character and be up to 256 characters in length.
Input configuration
Dataset
Select the dataset to process. You can select only a mixed dataset. After you select a dataset, you must also select its Version. By default, the first version of the dataset in ascending order is selected.
If this operator is a downstream component of another operator, the dataset selected here is typically the same as the output dataset of the upstream operator.
Input field
The storage path of the Excel file. You must select a source field from the input dataset. You can select only fields for which the Is URL parameter is set to Yes.
Filter condition (Optional)
Use SQL syntax. Enter only the condition that follows the
WHEREclause. You can use global system variables, such as${bizdate}for the business date.Operator configuration
Model-assisted correction
If this feature is disabled, only the built-in model is used for layout analysis and table extraction. If enabled and the built-in model produces poor parsing results (such as layout misalignments), an LLM automatically makes corrections and improves parsing accuracy.
Image content understanding
If this feature is enabled, a large language model (LLM) analyzes the content of images in the Excel file and replaces the images with text descriptions in the output Markdown. You must also enter an Image understanding prompt of up to 2,000 characters.
Model
You can configure this parameter only when model-assisted correction or image content understanding is enabled. Both features share the same model. You can select only models that are Enabled under Intelligent Application Management > Model Configuration and have a model type of Text or Vision (Images and Videos).
Note-
For the pricing factors of system models, see Built-in models supported by intelligent applications.
-
If you have purchased an advanced authorization package for your own models, no Credits are deducted. Otherwise, a 0.2x rate applies.
Output configuration
Dataset
You can select source dataset or other dataset. If the source dataset is a table dataset, other dataset is selected by default.
When you select other dataset, you must specify a mixed dataset and its Version as the output dataset. By default, the first version of the dataset in ascending order is selected. You can also select a different version of the source dataset.
When you select source dataset, the operator writes the generated metadata to the metadata table of the corresponding version of the source dataset.
File output path
Enter a directory name. If the directory does not exist, the system automatically creates it.
-
The parsed Markdown file is named using the format
${Excel file name+auto-incrementing number starting from 1}.md. -
A folder is generated for the parsed images, and all images are stored in this folder.
Include image links in output Markdown
Select Yes to replace parsed images with links to where they are stored. Select No to remove image links.
Loading policy
If the metadata table of the selected output dataset contains a primary key, update on primary key conflict is selected by default. If a primary key does not exist, append data is selected by default.
-
Append data: Adds new data to the target table. An error is reported if a primary key or constraint conflict occurs.
-
Update on primary key conflict: If a primary key or constraint conflict occurs, the existing row with the duplicate primary key is deleted before the new data is inserted.
-
Overwrite: Deletes all data from the target table before writing the new data.
NoteWhen you select source dataset as the output dataset, the loading policy only supports update on primary key conflict.
Field mapping
The Excel parsing operator outputs the following fields:
-
markdown_url: The storage path of the Markdown file. -
markdown_content: The content of the Markdown file. This field is optional. If the content is long, do not map this field to the output dataset. -
image_folder_url: The storage path of the image folder.
By default, the operator maps its output fields to fields with the same names in the output dataset. You can also manually select target fields for custom mapping. You can also map passthrough fields from the source dataset to the target dataset. You can manage field mappings in the following ways:
-
Add output field: Click to add a new, empty field mapping row. This feature is available only when you select other dataset as the output dataset.
-
Batch mapping: Click to choose a batch mapping method: manual mapping, map by name, or map by row index. This feature is available only when you select other dataset as the output dataset.
-
Delete mapping: Click the Delete icon to delete the corresponding field mapping row. You cannot delete mappings for the operator's fixed output fields.
-
-
After you complete the configuration, click Save in the top menu bar of the canvas to save the configuration.
After you configure an operator, you can add upstream or downstream operators to build a complete workflow.
Appendix 1: Excel to Markdown mapping
|
Excel element |
Markdown output |
Notes |
|
Sheet name |
|
Converted to an H1 heading. |
|
Hidden sheet |
Parsed by default. |
- |
|
Header row (first row) |
Header of the Markdown table. |
The operator automatically identifies the first row as the header. |
|
Data rows |
Body of the Markdown table. |
Converted row by row. |
|
Formulas |
The calculated value. |
The formula is not preserved. |
|
Number formats (percentage, currency, date) |
Converted to formatted text. |
For example, |
|
Unordered lists |
|
Supports multi-level indentation. |
|
Hyperlinks |
|
Preserves the link text and target URL. |
|
Embedded images |
|
The operator extracts the image to OSS. |
|
Embedded objects such as charts and bar graphs |
- |
- |
|
Comments |
Skipped (default) |
Comments are not usually considered part of the core data. |
|
Conditional formatting (color scales) |
Skipped in Markdown mode. |
- |
|
Data validation (drop-down lists) |
The operator uses the cell's current value and ignores the validation rule. |
Only the actual data is used. |
|
Empty rows |
The operator skips consecutive empty rows. |
This prevents excessive empty lines in the Markdown output. |
|
Separator between sheets |
|
A horizontal rule is used. |
Appendix 2: Exception handling
|
Issue |
Handling |
|
The file is not a valid .xlsx file (for example, it is corrupted or has a disguised file extension). |
Dataphin reports an error: |
|
The .xlsx file is encrypted or password-protected. |
Dataphin reports an error: |
|
All sheets in the file are empty. |
The operator returns an empty |
|
The operator fails to extract the underlying data of a chart. |
The operator falls back to rendering a screenshot of the chart. |
|
The chart rendering also fails. |
The operator inserts a placeholder: |
|
The operator fails to extract an embedded image. |
The operator skips the image and inserts a placeholder: |
|
A formula calculation depends on an external data source. |
The operator uses the cached value (the last calculated result when the Excel file was saved). If no cached value is available, the operator displays |