{
    "content": [
        {
            "type": "text",
            "text": "# CSPLIT (man)\n\n## NAME\n\ncsplit - split a file into sections determined by context lines\n\n## SYNOPSIS\n\ncsplit [OPTION]... FILE PATTERN...\n\n## DESCRIPTION\n\nOutput  pieces  of FILE separated by PATTERN(s) to files 'xx00', 'xx01', ..., and output byte\ncounts of each piece to standard output.\n\n## TLDR\n\n> Split a file into pieces.\n\n- Split a file in two parts, starting the second one at line 10:\n  `csplit {{path/to/file}} 10`\n- Split a file in three parts, starting the latter parts in lines 7 and 23:\n  `csplit {{path/to/file}} 7 23`\n- Start a new part at every 5th line (will fail if number of lines is not divisible by 5):\n  `csplit {{path/to/file}} 5 {*}`\n- Start a new part at every 5th line, ignoring exact-division error:\n  `csplit {{-k|--keep-files}} {{path/to/file}} 5 {*}`\n- Split a file above line 5 and use a custom prefix for the output files (default is `xx`):\n  `csplit {{path/to/file}} 5 {{-f|--prefix}} {{prefix}}`\n- Split a file above the first line matching a `regex` pattern:\n  `csplit {{path/to/file}} /{{regex}}/`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (9 subsections)\n- **AUTHOR**\n- **REPORTING BUGS**\n- **COPYRIGHT**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "CSPLIT",
        "section": "",
        "mode": "man",
        "summary": "csplit - split a file into sections determined by context lines",
        "synopsis": "csplit [OPTION]... FILE PATTERN...",
        "tldr_summary": "Split a file into pieces.",
        "tldr_examples": [
            {
                "description": "Split a file in two parts, starting the second one at line 10",
                "command": "csplit {{path/to/file}} 10"
            },
            {
                "description": "Split a file in three parts, starting the latter parts in lines 7 and 23",
                "command": "csplit {{path/to/file}} 7 23"
            },
            {
                "description": "Start a new part at every 5th line (will fail if number of lines is not divisible by 5)",
                "command": "csplit {{path/to/file}} 5 {*}"
            },
            {
                "description": "Start a new part at every 5th line, ignoring exact-division error",
                "command": "csplit {{-k|--keep-files}} {{path/to/file}} 5 {*}"
            },
            {
                "description": "Split a file above line 5 and use a custom prefix for the output files (default is `xx`)",
                "command": "csplit {{path/to/file}} 5 {{-f|--prefix}} {{prefix}}"
            },
            {
                "description": "Split a file above the first line matching a `regex` pattern",
                "command": "csplit {{path/to/file}} /{{regex}}/"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "-b",
                "long": "--suffix-format",
                "arg": null,
                "description": "use sprintf FORMAT instead of %02d"
            },
            {
                "flag": "-f",
                "long": "--prefix",
                "arg": null,
                "description": "use PREFIX instead of 'xx'"
            },
            {
                "flag": "-k",
                "long": "--keep-files",
                "arg": null,
                "description": "do not remove output files on errors"
            },
            {
                "flag": "",
                "long": "--suppress-matched",
                "arg": null,
                "description": "suppress the lines matching PATTERN"
            },
            {
                "flag": "-n",
                "long": "--digits",
                "arg": null,
                "description": "use specified number of digits instead of 2"
            },
            {
                "flag": "-s",
                "long": "--silent",
                "arg": null,
                "description": "do not print counts of output file sizes"
            },
            {
                "flag": "-z",
                "long": "--elide-empty-files",
                "arg": null,
                "description": "remove empty output files --help display this help and exit"
            },
            {
                "flag": "",
                "long": "--version",
                "arg": null,
                "description": "output version information and exit"
            }
        ],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 7,
                "subsections": [
                    {
                        "name": "-b --suffix-format",
                        "lines": 2,
                        "flag": "-b",
                        "long": "--suffix-format"
                    },
                    {
                        "name": "-f --prefix",
                        "lines": 2,
                        "flag": "-f",
                        "long": "--prefix"
                    },
                    {
                        "name": "-k --keep-files",
                        "lines": 2,
                        "flag": "-k",
                        "long": "--keep-files"
                    },
                    {
                        "name": "--suppress-matched",
                        "lines": 2,
                        "long": "--suppress-matched"
                    },
                    {
                        "name": "-n --digits",
                        "lines": 2,
                        "flag": "-n",
                        "long": "--digits"
                    },
                    {
                        "name": "-s --quiet --silent",
                        "lines": 2,
                        "flag": "-s",
                        "long": "--silent"
                    },
                    {
                        "name": "-z --elide-empty-files",
                        "lines": 4,
                        "flag": "-z",
                        "long": "--elide-empty-files"
                    },
                    {
                        "name": "--version",
                        "lines": 2,
                        "long": "--version"
                    },
                    {
                        "name": "Each PATTERN may be:",
                        "lines": 16
                    }
                ]
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "csplit - split a file into sections determined by context lines\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "csplit [OPTION]... FILE PATTERN...\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Output  pieces  of FILE separated by PATTERN(s) to files 'xx00', 'xx01', ..., and output byte\ncounts of each piece to standard output.\n\nRead standard input if FILE is -\n\nMandatory arguments to long options are mandatory for short options too.\n",
                "subsections": [
                    {
                        "name": "-b --suffix-format",
                        "content": "use sprintf FORMAT instead of %02d\n",
                        "flag": "-b",
                        "long": "--suffix-format"
                    },
                    {
                        "name": "-f --prefix",
                        "content": "use PREFIX instead of 'xx'\n",
                        "flag": "-f",
                        "long": "--prefix"
                    },
                    {
                        "name": "-k --keep-files",
                        "content": "do not remove output files on errors\n",
                        "flag": "-k",
                        "long": "--keep-files"
                    },
                    {
                        "name": "--suppress-matched",
                        "content": "suppress the lines matching PATTERN\n",
                        "long": "--suppress-matched"
                    },
                    {
                        "name": "-n --digits",
                        "content": "use specified number of digits instead of 2\n",
                        "flag": "-n",
                        "long": "--digits"
                    },
                    {
                        "name": "-s --quiet --silent",
                        "content": "do not print counts of output file sizes\n",
                        "flag": "-s",
                        "long": "--silent"
                    },
                    {
                        "name": "-z --elide-empty-files",
                        "content": "remove empty output files\n\n--help display this help and exit\n",
                        "flag": "-z",
                        "long": "--elide-empty-files"
                    },
                    {
                        "name": "--version",
                        "content": "output version information and exit\n",
                        "long": "--version"
                    },
                    {
                        "name": "Each PATTERN may be:",
                        "content": "INTEGER\ncopy up to but not including specified line number\n\n/REGEXP/[OFFSET]\ncopy up to but not including a matching line\n\n%REGEXP%[OFFSET]\nskip to, but not including a matching line\n\n{INTEGER}\nrepeat the previous pattern specified number of times\n\n{*}    repeat the previous pattern as many times as possible\n\nA line OFFSET is a required '+' or '-' followed by a positive integer.\n"
                    }
                ]
            },
            "AUTHOR": {
                "content": "Written by Stuart Kemp and David MacKenzie.\n",
                "subsections": []
            },
            "REPORTING BUGS": {
                "content": "GNU coreutils online help: <https://www.gnu.org/software/coreutils/>\nReport any translation bugs to <https://translationproject.org/team/>\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright © 2020 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3  or  later\n<https://gnu.org/licenses/gpl.html>.\nThis  is free software: you are free to change and redistribute it.  There is NO WARRANTY, to\nthe extent permitted by law.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "Full documentation <https://www.gnu.org/software/coreutils/csplit>\nor available locally via: info '(coreutils) csplit invocation'\n\n\n\nGNU coreutils 8.32                          January 2026                                   CSPLIT(1)",
                "subsections": []
            }
        }
    }
}