1Fsdb::Filter::dbcolspliUtsteorcoClosn(t3r)ibuted Perl DoFcsudmbe:n:tFaitlitoenr::dbcolsplittocols(3)
2
3
4

NAME

6       dbcolsplittocols - split an existing column into multiple new columns
7

SYNOPSIS

9       dbcolsplittocols [-E] [-C ElementSeparator] column
10

DESCRIPTION

12       Create new columns by splitting an existing column.  The fragments of
13       the column are each divided by ElementSeparator (default is
14       underscore).
15
16       This command is the opposite of dbcolmerge.  Names of the new columns
17       are given by splitting the name of the existing column.  dbcolrename
18       may be useful to set column names.
19

OPTIONS

21       -C S or --element-separator S
22           Specify the separator S used to join columns.  Usually a signle
23           character, it can also be a regular expression (so, for example,
24           [,_] matches either , or _ as an element separator.)  (Defaults to
25           a single underscore.)
26
27       -E or --enumerate
28           Enumerate output columns: rather than assuming the column name uses
29           the element separator, we keep it whole and fill in with indexes
30           starting from 0.  (Not currently implemented, but planned.  See
31           dbcolsplittorows.)
32
33       -N on --new-name
34           Specify the names of the new columns as a space separated list.
35           (Default is to apply the separator to the name of the column that
36           is being split.)
37
38           By default, column "a_b" will split to columns a and b.  If the
39           column is given as ab with option "-N 'a b'", one will get the same
40           result.
41
42       -E or --enumerate
43           Enumerate output columns: rather than assuming the column name uses
44           the element separator, we keep it whole and fill in with indexes
45           starting from 0.  (Not currently implemented, but planned.  See
46           dbcolsplittorows.)
47
48       This module also supports the standard fsdb options:
49
50       -d  Enable debugging output.
51
52       -i or --input InputSource
53           Read from InputSource, typically a file name, or "-" for standard
54           input, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue
55           objects.
56
57       -o or --output OutputDestination
58           Write to OutputDestination, typically a file name, or "-" for
59           standard output, or (if in Perl) a IO::Handle, Fsdb::IO or
60           Fsdb::BoundedQueue objects.
61
62       --autorun or --noautorun
63           By default, programs process automatically, but Fsdb::Filter
64           objects in Perl do not run until you invoke the run() method.  The
65           "--(no)autorun" option controls that behavior within Perl.
66
67       --header H
68           Use H as the full Fsdb header, rather than reading a header from
69           then input.
70
71       --help
72           Show help.
73
74       --man
75           Show full manual.
76

SAMPLE USAGE

78   Input:
79           #fsdb      first_last
80           John_Heidemann
81           Greg_Johnson
82           Root
83           # this is a simple database
84           #  | dbcolrename fullname first_last
85           #  | /home/johnh/BIN/DB/dbcol first_last
86
87   Command:
88           cat data.fsdb | dbcolsplittocols first_last
89
90   Output:
91           #fsdb      first_last      first   last
92           John_Heidemann  John    Heidemann
93           Greg_Johnson    Greg    Johnson
94           Root    Root
95           # this is a simple database
96           #  | dbcolrename fullname first_last
97           #  | /home/johnh/BIN/DB/dbcol first_last
98           #  | /home/johnh/BIN/DB/dbcolsplittocols first_last
99

SEE ALSO

101       Fsdb(3).  dbcolmerge(1).  dbcolsplittorows(1).  dbcolrename(1).
102

CLASS FUNCTIONS

104   new
105           $filter = new Fsdb::Filter::dbcolsplittocols(@arguments);
106
107       Create a new dbcolsplittocols object, taking command-line arguments.
108
109   set_defaults
110           $filter->set_defaults();
111
112       Internal: set up defaults.
113
114   parse_options
115           $filter->parse_options(@ARGV);
116
117       Internal: parse command-line arguments.
118
119   setup
120           $filter->setup();
121
122       Internal: setup, parse headers.
123
124   run
125           $filter->run();
126
127       Internal: run over each rows.
128
130       Copyright (C) 1991-2018 by John Heidemann <johnh@isi.edu>
131
132       This program is distributed under terms of the GNU general public
133       license, version 2.  See the file COPYING with the distribution for
134       details.
135
136
137
138perl v5.32.1                      2021-01-27 Fsdb::Filter::dbcolsplittocols(3)
Impressum