csplit
Partition data by content patterns: split input at each regex match, generating separate output files. Use dry-run to preview split points without writing.
Instructions
Split input into multiple files at regex match points with dry-run and overwrite protection. Destructive: creates output files on the filesystem. Use --dry_run to preview split points without creating files. Returns JSON with generated filenames and record counts. Use to partition data by content patterns. Not for fixed-size splitting — use 'split' for line-count or byte-size chunks. See also 'split'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| allow_overwrite | No | Allow replacing existing outputs. | |
| dry_run | No | Report split outputs without writing files. | |
| encoding | No | Text encoding. | utf-8 |
| max_splits | No | Maximum regex matches to split at; 0 means all. | |
| output_dir | No | Directory for split outputs. | . |
| path | Yes | File to split, or '-' for stdin. | |
| pattern | No | Regular expression; each match starts a new chunk. | |
| prefix | No | Output file prefix. | xx |
| suffix_length | No | Numeric suffix length. |