1Fsdb::Filter::dbcol(3)User Contributed Perl DocumentationFsdb::Filter::dbcol(3)
2
3
4
6 dbcol - select columns from an Fsdb file
7
9 dbcol [-v] [-e -] [column...]
10
12 Select one or more columns from the input database. If a value is
13 given for empty columns with the -e option, then any named columns
14 which don't exist will be created. Otherwise, non-existent columns are
15 an error.
16
17 Note: a safer way to create columns is dbcolcreate.
18
20 -r or --relaxed-errors
21 Relaxed error checking: ignore columns that aren't there.
22
23 -v or --invert-match
24 Output all columns except those listed (like grep -v).
25
26 -a or --all
27 Output all columns, in addition to those listed. (Thus "-a foo"
28 will move column foo to the first column.)
29
30 -e EmptyValue or --empty
31 Specify the value newly created columns get.
32
33 --saveoutput $OUT_REF
34 Save output writer (for integration with other fsdb filters).
35
36 and the standard fsdb options:
37
38 -d Enable debugging output.
39
40 -i or --input InputSource
41 Read from InputSource, typically a file, or - for standard input,
42 or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue
43 objects.
44
45 -o or --output OutputDestination
46 Write to OutputDestination, typically a file, or - for standard
47 output, or (if in Perl) a IO::Handle, Fsdb::IO or
48 Fsdb::BoundedQueue objects.
49
50 --autorun or --noautorun
51 By default, programs process automatically, but Fsdb::Filter
52 objects in Perl do not run until you invoke the run() method. The
53 "--(no)autorun" option controls that behavior within Perl.
54
55 --header H
56 Use H as the full Fsdb header, rather than reading a header from
57 then input.
58
59 --help
60 Show help.
61
62 --man
63 Show full manual.
64
66 Input:
67 #fsdb account passwd uid gid fullname homedir shell
68 johnh * 2274 134 John_Heidemann /home/johnh /bin/bash
69 greg * 2275 134 Greg_Johnson /home/greg /bin/bash
70 root * 0 0 Root /root /bin/bash
71 # this is a simple database
72
73 Command:
74 cat DATA/passwd.fsdb account | dbcol account
75
76 Output:
77 #fsdb account
78 johnh
79 greg
80 root
81 # this is a simple database
82 # | dbcol account
83
85 dbcolcreate(1), Fsdb(3)
86
88 new
89 $filter = new Fsdb::Filter::dbcol(@arguments);
90
91 Create a new dbcol object, taking command-line arguments.
92
93 set_defaults
94 $filter->set_defaults();
95
96 Internal: set up defaults.
97
98 parse_options
99 $filter->parse_options(@ARGV);
100
101 Internal: parse options
102
103 setup
104 $filter->setup();
105
106 Internal: setup, parse headers.
107
108 run
109 $filter->run();
110
111 Internal: run over all data rows.
112
113 finish
114 $filter->finish();
115
116 Internal: write trailer.
117
119 Copyright (C) 1991-2022 by John Heidemann <johnh@isi.edu>
120
121 This program is distributed under terms of the GNU general public
122 license, version 2. See the file COPYING with the distribution for
123 details.
124
125
126
127perl v5.34.1 2022-04-04 Fsdb::Filter::dbcol(3)