> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/stackai-tools/document-processing/split-sheets.md).

# Split Sheets

Divide CSV or Excel data into smaller groups of rows. Use it to process a large table in parts while keeping each worksheet separate.

## Use this tool

1. Supply **File URL** for the CSV or Excel file.
2. Choose **Split Mode** and enter **Number of Rows** or **Number of Chunks**.
3. Keep **Include Headers** enabled if each group needs its column names.
4. Run the tool and inspect **Chunks**, grouped by worksheet name.

## Behavior and limits

Headers are additional to the data-row limit. Each Excel worksheet is split separately; a CSV uses the name Sheet1. The returned chunks are CSV text grouped by sheet, not a single newly created Excel workbook.

## Inputs

| Field                 | Parameter         | Description                                                                                                                                                                                                                                                                     |
| --------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| File URL (required)   | `file_url`        | URL of the CSV or Excel file to be split                                                                                                                                                                                                                                        |
| Split Mode (required) | `split_mode`      | Choose how to split: by number of rows per chunk or by total number of chunks                                                                                                                                                                                                   |
| Number of Rows        | `num_rows`        | Number of data rows per chunk when using Number of Rows split mode. Headers are additional and not counted toward this limit. For example, if num\_rows=5 with headers enabled creates chunks of 6 rows (1 header + 5 data). Default is 100 rows per chunk. Must be at least 1. |
| Number of Chunks      | `num_chunks`      | Total number of chunks to create when using 'num\_chunks' split mode. Default is 5 chunks. Must be between 1 and 200.                                                                                                                                                           |
| Include Headers       | `include_headers` | Whether to include the header row in each chunk. When enabled, each chunk will start with the column headers as an additional row. Headers are not counted toward the number of rows limit. Default is true.                                                                    |

## Outputs

| Field  | Parameter | Description                                                                                                                                                                          |
| ------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Chunks | `chunks`  | Dictionary mapping sheet names to their CSV chunks. For CSV files, uses 'Sheet1' as the key. For Excel files, each worksheet is processed separately with its sheet name as the key. |

## Related guides

* [Parsing, OCR, and Document Structure](https://docs.stackai.com/technical-reference/files-knowledge-and-retrieval/parsing-ocr-and-document-structure.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/stackai-tools/document-processing/split-sheets.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
