1DBCOLSPLITTOCOLS(1) User Contributed Perl Documentation DBCOLSPLITTOCOLS(1)
2
3
4
6 dbcolsplittocols - split an existing column into multiple new columns
7
9 dbcolsplittocols [-E] [-C ElementSeparator] column
10
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
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
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
101 Fsdb(3). dbcolmerge(1). dbcolsplittorows(1). dbcolrename(1).
102
104 Copyright (C) 1991-2018 by John Heidemann <johnh@isi.edu>
105
106 This program is distributed under terms of the GNU general public
107 license, version 2. See the file COPYING with the distribution for
108 details.
109
110
111
112perl v5.30.0 2019-09-19 DBCOLSPLITTOCOLS(1)