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
20 Input treated as strings and output columns are of type string.
21
23 -C S or --element-separator S
24 Specify the separator S used to join columns. Usually a signle
25 character, it can also be a regular expression (so, for example,
26 [,_] matches either , or _ as an element separator.) (Defaults to
27 a single underscore.)
28
29 -E or --enumerate
30 Enumerate output columns: rather than assuming the column name uses
31 the element separator, we keep it whole and fill in with indexes
32 starting from 0. (Not currently implemented, but planned. See
33 dbcolsplittorows.)
34
35 -N on --new-name
36 Specify the names of the new columns as a space separated list.
37 (Default is to apply the separator to the name of the column that
38 is being split.)
39
40 By default, column "a_b" will split to columns a and b. If the
41 column is given as ab with option "-N 'a b'", one will get the same
42 result.
43
44 -E or --enumerate
45 Enumerate output columns: rather than assuming the column name uses
46 the element separator, we keep it whole and fill in with indexes
47 starting from 0. (Not currently implemented, but planned. See
48 dbcolsplittorows.)
49
50 This module also supports the standard fsdb options:
51
52 -d Enable debugging output.
53
54 -i or --input InputSource
55 Read from InputSource, typically a file name, or "-" for standard
56 input, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue
57 objects.
58
59 -o or --output OutputDestination
60 Write to OutputDestination, typically a file name, or "-" for
61 standard output, or (if in Perl) a IO::Handle, Fsdb::IO or
62 Fsdb::BoundedQueue objects.
63
64 --autorun or --noautorun
65 By default, programs process automatically, but Fsdb::Filter
66 objects in Perl do not run until you invoke the run() method. The
67 "--(no)autorun" option controls that behavior within Perl.
68
69 --header H
70 Use H as the full Fsdb header, rather than reading a header from
71 then input.
72
73 --help
74 Show help.
75
76 --man
77 Show full manual.
78
80 Input:
81 #fsdb first_last
82 John_Heidemann
83 Greg_Johnson
84 Root
85 # this is a simple database
86 # | dbcolrename fullname first_last
87 # | /home/johnh/BIN/DB/dbcol first_last
88
89 Command:
90 cat data.fsdb | dbcolsplittocols first_last
91
92 Output:
93 #fsdb first_last first last
94 John_Heidemann John Heidemann
95 Greg_Johnson Greg Johnson
96 Root Root
97 # this is a simple database
98 # | dbcolrename fullname first_last
99 # | /home/johnh/BIN/DB/dbcol first_last
100 # | /home/johnh/BIN/DB/dbcolsplittocols first_last
101
103 Fsdb(3). dbcolmerge(1). dbcolsplittorows(1). dbcolrename(1).
104
106 Copyright (C) 1991-2022 by John Heidemann <johnh@isi.edu>
107
108 This program is distributed under terms of the GNU general public
109 license, version 2. See the file COPYING with the distribution for
110 details.
111
112
113
114perl v5.36.0 2022-11-22 DBCOLSPLITTOCOLS(1)