home *** CD-ROM | disk | FTP | other *** search
/ Dream 51 / Amiga_Dream_51.iso / Atari / Desktops / text113b.zoo / textutils-1.13 / man / csplit.1 < prev    next >
Text File  |  1996-01-21  |  7KB  |  199 lines

  1.  
  2.  
  3.  
  4. CSPLIT(1)                                               CSPLIT(1)
  5.  
  6.  
  7. NNAAMMEE
  8.        csplit  - split a file into sections determined by context
  9.        lines
  10.  
  11. SSYYNNOOPPSSIISS
  12.        ccsspplliitt [-sqkz] [-f prefix] [-b suffix] [-n digits] [--pre-
  13.        fix=prefix]   [--suffix-format=suffix]   [--digits=digits]
  14.        [--quiet] [--silent] [--keep-files]  [--elide-empty-files]
  15.        [--help] [--version] file pattern...
  16.  
  17. DDEESSCCRRIIPPTTIIOONN
  18.        This  manual  page  documents  the  GNU version of ccsspplliitt.
  19.        ccsspplliitt creates zero or more output files  containing  sec-
  20.        tions  of  the  given input _f_i_l_e, or the standard input if
  21.        the name `-' is given.  By default, ccsspplliitt prints the num-
  22.        ber of bytes written to each output file after it has been
  23.        created.
  24.  
  25.        The contents of the output files  are  determined  by  the
  26.        _p_a_t_t_e_r_n  arguments.  An error occurs if a pattern argument
  27.        refers to a nonexistent line of the input file, such as if
  28.        no  remaining  line  matches  a  given regular expression.
  29.        After all  the  given  patterns  have  been  matched,  any
  30.        remaining output is copied into one last output file.  The
  31.        types of pattern arguments are:
  32.  
  33.               _l_i_n_e
  34.                      Create an output file containing the current
  35.                      line  up to (but not including) line _l_i_n_e (a
  36.                      positive integer) of  the  input  file.   If
  37.                      followed  by  a repeat count, also create an
  38.                      output file containing the next  _l_i_n_e  lines
  39.                      of the input file once for each repeat.
  40.  
  41.               /_r_e_g_e_x_p/[_o_f_f_s_e_t]
  42.                      Create an output file containing the current
  43.                      line up to (but not including) the next line
  44.                      of  the input file that contains a match for
  45.                      _r_e_g_e_x_p.  The optional _o_f_f_s_e_t is a `+' or `-'
  46.                      followed  by  a  positive integer.  If it is
  47.                      given, the input up  to  the  matching  line
  48.                      plus  or minus _o_f_f_s_e_t is put into the output
  49.                      file, and the line  after  that  begins  the
  50.                      next section of input.
  51.  
  52.               %_r_e_g_e_x_p%[_o_f_f_s_e_t]
  53.                      Like  the previous type, except that it does
  54.                      not create an output file, so  that  section
  55.                      of the input file is effectively ignored.
  56.  
  57.               {_r_e_p_e_a_t_-_c_o_u_n_t}
  58.                      Repeat  the previous pattern _r_e_p_e_a_t_-_c_o_u_n_t (a
  59.                      positive  integer)  additional   times.   An
  60.                      asterisk  may  be  given  in  place  of  the
  61.  
  62.  
  63.  
  64. FSF                     GNU Text Utilities                      1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. CSPLIT(1)                                               CSPLIT(1)
  71.  
  72.  
  73.                      (integer) repeat count, in  which  case  the
  74.                      preceeding pattern is repeated as many times
  75.                      as necessary until the input is exausted.
  76.  
  77.        The output file names consist of a prefix  followed  by  a
  78.        suffix.   By  default,  the  suffix is merely an ascending
  79.        linear sequence of two-digit decimal numbers starting with
  80.        00 and ranging up to 99, however this default may be over-
  81.        ridden by either the _-_-_d_i_g_i_t_s  option  or  by  the  _-_-_s_u_f_-
  82.        _f_i_x_-_f_o_r_m_a_t option.  (See below.)  In any case, concatenat-
  83.        ing the output files in sorted order by file name produces
  84.        the  original  input  file,  in order.  The default output
  85.        file name prefix is `xx'.
  86.  
  87.        By default, if ccsspplliitt encounters an error  or  receives  a
  88.        hangup,  interrupt,  quit, or terminate signal, it removes
  89.        any output files that it has  created  so  far  before  it
  90.        exits.
  91.  
  92.    OOPPTTIIOONNSS
  93.        _-_f_, _-_-_p_r_e_f_i_x_=_p_r_e_f_i_x
  94.               Use _p_r_e_f_i_x as the output file name prefix string.
  95.  
  96.        _-_b_, _-_-_s_u_f_f_i_x_-_f_o_r_m_a_t_=_s_u_f_f_i_x
  97.               Use  _s_u_f_f_i_x  as the output file name suffix string.
  98.               When this option is specified,  the  suffix  string
  99.               must include exactly one printf(3) style conversion
  100.               specification (such as %d, possibly including  for-
  101.               mat specification flags, a field width, a precision
  102.               specifications, or all  of  these  kinds  of  modi-
  103.               fiers).  The conversion specification must be suit-
  104.               able for converting a binary  integer  argument  to
  105.               readable form.  Thus, only `d', 'i', `u', `o', `x',
  106.               and `X' format specifiers are allowed.  The  entire
  107.               suffix  string  is  given  (with the current output
  108.               file number) to sprintf(3) to form  the  file  name
  109.               suffixes for each of the individual output files in
  110.               turn.  Note that when  this  option  is  used,  the
  111.               _-_-_d_i_g_i_t_s option is ignored.
  112.  
  113.        _-_n_, _-_-_d_i_g_i_t_s_=_d_i_g_i_t_s
  114.               Use  output  file names containing numbers that are
  115.               _d_i_g_i_t_s digits long instead of the default 2.
  116.  
  117.        _-_k_, _-_-_k_e_e_p_-_f_i_l_e_s
  118.               Do not remove output files when errors are  encoun-
  119.               tered.
  120.  
  121.        _-_z_, _-_-_e_l_i_d_e_-_e_m_p_t_y_-_f_i_l_e_s
  122.               Suppress   the  generation  of  zero-length  output
  123.               files.  (In cases where the section  delimiters  of
  124.               the input file are supposed to mark the first lines
  125.               of each of the sections, the first output file will
  126.               generally be a zero-length file unless you use this
  127.  
  128.  
  129.  
  130. FSF                     GNU Text Utilities                      2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. CSPLIT(1)                                               CSPLIT(1)
  137.  
  138.  
  139.               option.)  Note that the output file  sequence  num-
  140.               bers  will  always run consecutively, starting from
  141.               0, even in cases where zero-length output  sections
  142.               are suppressed due to the use of this option.
  143.  
  144.        _-_s_, _-_q_, _-_-_s_i_l_e_n_t_, _-_-_q_u_i_e_t
  145.               Do not print counts of output file sizes.
  146.  
  147.        _-_-_h_e_l_p Print  a  usage message and exit with a status code
  148.               indicating success.
  149.  
  150.        _-_-_v_e_r_s_i_o_n
  151.               Print version information on standard  output  then
  152.               exit.
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196. FSF                     GNU Text Utilities                      3
  197.  
  198.  
  199.