CSPLIT(1)

NAME
csplit - split files based on context

SYNOPSIS
csplit [-ksq?] [-f prefix] [-n width] [--keep] [--silent] [--quiet] [--prefix prefix] [--sequence-width width] file cmd1 . . . cmdn

DESCRIPTION
Csplit read file (or the standard input, if the file is -) and writes all or part of it into other files as specified by the cmd arguments, and writes the size of those files.

SPLITTING COMMANDS
The input file can be split according to the following commands:

/re/[offset]
Create a file containing the contents of the current line up to,
    but not including the line containing the given regular expression +/- the number of offset lines.

%re%[offset]
    As above, but don't actually create a new file.

line_no
    Create a file containing the contents of the current line up to line line_no. Note that line numbering begins with 1, not with 0, so a 2 command will return 1 line instead of two.

{count}
    Repeat the previous command count times. If this command follows a re command, that command is applied count more times, and if this command follows a line_no command, the file will be split into count new files containing line_no lines starting at the current line.

If any of these commands don't reference a line between the current line and the end of the file, csplit will report an error, delete all created files, and exit.

OPTIONS
The following options are supported.

-f
Name the created files
    prefix00, prefix01, ... prefixnn, instead of the default xx00 ... xxnn.

-k  Tell csplit not to delete any created files if an error happens while picking the input file apart.

-n  Use width digits to form filenames for the created files (eg: -w3 creates filenames of the form prefix000 ...IB prefix nnn)

-s  Do the splitting as quietly as possible.

-?  Give a short help message, then exit.

--version
    Give csplit's version number, then exit.

AUTHOR
David Parsons ( orc@pell.chi.il.us )

BUGS
This program was written from looking at the output of GNU csplit, plus TOG's manpage for Single Unix V2, so it's sort of a bastard hybrid of GNU and the standard.