SYNOPSIS
csplit [-s] [-k] [-f prefix] [-n digits] file args ...
DESCRIPTION
Csplit reads file and writes it in pieces as specified by the further
operands args. The destination file names have the form xx00, xx01,
and so on by default.
The args operands can have one of the following forms:
/rexp/[[+|-]offset] Write text between the current line and the next
line matching the regular expression rexp to an
output file piece. If offset is also specified,
writing ends offset lines below the matching line
for positive values, or above the matching line for
negative ones. The text section written to the
next file piece starts at the matching line with
offsetapplied; thus repeated matches with negative
offsets will repeatedly write the same text part.
With /usr/5bin/csplit, rexp is treated as a simple
regular expression, whereas /usr/5bin/s42/csplit,
/usr/5bin/posix/csplit, and
/usr/5bin/posix2001/csplit treat it as a basic reg-
ular expression (see ed(1). Backslash escapes a
literal `/' in the expression.
%rexp%[[+|-]offset] Also match rexp as described above, but skip the
text between the current line and the matching one
(plus offset) instead of writing it. Backslash
escapes `%'.
number Create a piece of the file for the text between the
current line and line number. Line numbering
starts at 1.
{repetition} Apply the previous argument additionally repetition
times if it searches for a regular expression. If
it specifies a line number, include the text
between the current line and the current line plus
the line count given in the argument, and repeat
this process repetition times.
The following options can be used with csplit:
-f prefix
Use the given prefix as the first part of the file names created
(instead of xx).
-n digits
Use digits positions for the second part of the file names cre-
ated, instead of the default 2. This allows for the creation of
more than 100 file pieces. This option was introduced by
csplit -k -f section doc.ms '/^.[NS]H/' {100}
ENVIRONMENT VARIABLES
LANG, LC_ALL
See locale(7).
LC_COLLATE
Affects the collation order for range expressions, equivalence
classes, and collation symbols in basic regular expressions.
LC_CTYPE
Determines the mapping of bytes to characters, the set of word
boundary characters and the composition of character classes in
basic regular expressions.
SEE ALSO
ed(1), split(1)
Heirloom Toolchest 8/14/05 CSPLIT(1)
Man(1) output converted with
man2html