csplit(1) | csplit(1) |
NAME
csplit - context split
SYNOPSIS
csplit
DESCRIPTION
csplit reads ®le, separates it into n+1 sections as de®ned by the arguments arg1 ... argn, and places the results in separate ®les. The maximum number of arguments (arg1 through argn) allowed is 99 unless the
Default | Pre®xed |
|
|
Filename | Filename | Contents | |
xx00 | pre®x00 | From start of ®le up to (but not including) the line refer- |
|
|
| enced by arg1. | |
xx01 | pre®x01 | From the line referenced by arg1 up to the line referenced | |
|
| by arg2. | |
|
| . |
|
|
| . |
|
|
| . |
|
xxNN | pre®xNN | From the line referenced by argn to end of ®le. |
If the ®le argument is
csplit supports the Basic Regular Expression syntax (see regexp(5)).
Options
csplit recognizes the following options:
Suppress printing of all character counts (csplit normally prints the character | |
| counts for each ®le created). |
Leave previously created ®les intact (csplit normally removes created ®les if an | |
| error occurs). |
Name created ®les pre®x00 through pre®xNN (default is xx00 through xxNN. | |
The output ®le name suf®x will use number digits instead of the default 2. This | |
| allows creation of more than 100 output ®les. |
Arguments (arg1 through argn) to csplit can be any combination of the following:
/regexp/ Create a ®le containing the section from the current line up to (but not including) the line matching the regular expression regexp. The new current line becomes the line matching regexp.
/regexp/+n
%regexp% equivalent to /regexp/, except that no ®le is created for the section.
line_number Create a ®le from the current line up to (but not including) line_number. The new current line becomes line_number.
{num} Repeat argument. This argument can follow any of the above argument forms. If it follows a regexp argument, that argument is applied num more times. If it follows line_number, the ®le is split every line_number lines for num times from that point until
{*} | Repeats previous operand as many times as necessary to ®nish input. |
Enclose in appropriate quotes all regexp arguments containing blanks or other characters meaningful to the shell. Regular expressions must not contain embedded
− 1 − | Section 1−147 |
c