MPE/iX Shell and Utilities Reference Manual, Vol 1
csplit(1) MPE/iX Shell and Utilities csplit(1)
NAME
csplit — split a text file, according to criteria
SYNOPSIS
csplit [–Aaks][–f prefix][–n number] file arg arg ...
DESCRIPTION
csplit takes a text file as input and breaks up its contents into pieces, based on criteria
given by the arg value(s) on the command line. For example, you can use csplit to break
up a text file into chunks of ten lines each, then save each of those chunks in a separate file.
See the subsection Splitting Criteria for more details. If you specify – as the file argument,
csplit uses the standard input.
The files created by csplit normally have names of the form
xxnumber
where number is a two digit decimal number which begins at zero and increments by one for
each new file that csplit creates.
csplit also displays the size, in bytes, of each file that it creates.
Options
csplit accepts the following options:
–A uses uppercase letters in place of numbers in the number portion of created file
names. This generates names of the form xxAA, xxAB, and so on.
–a uses lowercase letters in place of numbers in the number portion of created file
names. This generates names of the form xxaa, xxab, and so on.
–f prefix
specifies a prefix to use in place of the default xx when naming files. If prefix causes
a file name longer than NAME_MAX bytes, an error occurs and csplit exits with-
out creating any files.
–k leaves all created files intact. Normally, when an error occurs, csplit removes
files that it has created.
–n number
specifies the number of digits in the number portion of created file names.
–s suppresses the display of file sizes.
1-138 Commands and Utilities