merge_datasets
Join two Excel sheets using SQL-style join (left, right, inner, outer) on matching columns and write results to an optional output sheet.
Instructions
Join two sheets within the workbook similar to SQL join semantics.
Args: file_path: Path to workbook. sheet1, sheet2: Names of the two sheets to join. join_key: Column name(s) common to both sheets (shorthand for left_on/right_on). how: One of "left", "right", "inner", "outer". output_sheet: Optional sheet name to write merged results. left_on, right_on: Optional explicit join keys for differently named columns.
Returns: dict: Key counts and output information.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| how | No | left | |
| sheet1 | Yes | ||
| sheet2 | Yes | ||
| left_on | No | ||
| join_key | No | ||
| right_on | No | ||
| file_path | Yes | ||
| output_sheet | No |