1Fsdb::Filter::db_to_htmUls_etrabCloen(t3r)ibuted Perl DoFcsudmbe:n:tFaitlitoenr::db_to_html_table(3)
2
3
4
6 db_to_html_table - convert db to an HTML table
7
9 db_to_html_table [-g N] <source.fsdb >dest.html
10
12 Covert an existing dbtable to an HTML table. The output is a fragment
13 of an HTML page; we assume the user fills in the rest (head and body,
14 etc.).
15
16 Input is fsdb format.
17
18 Output is HTML code (not fsdb), with HTML-specific characters (less
19 than, greater than, ampersand) are escaped. (The fsdb-1.x version
20 assumed input was ISO-8859-1; we now assume both input and output are
21 unicode. This change is considered a feature of the 21st century.)
22
24 -g N or <--group-count N>
25 Color groups of N consecutive rows with one background color.
26
27 This module also supports the standard fsdb options:
28
29 -d Enable debugging output.
30
31 -i or --input InputSource
32 Read from InputSource, typically a file name, or "-" for standard
33 input, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue
34 objects.
35
36 -o or --output OutputDestination
37 Write to OutputDestination, typically a file name, or "-" for
38 standard output, or (if in Perl) a IO::Handle, Fsdb::IO or
39 Fsdb::BoundedQueue objects.
40
41 --autorun or --noautorun
42 By default, programs process automatically, but Fsdb::Filter
43 objects in Perl do not run until you invoke the run() method. The
44 "--(no)autorun" option controls that behavior within Perl.
45
46 --help
47 Show help.
48
49 --man
50 Show full manual.
51
53 Input:
54 #fsdb -F S account passwd uid gid fullname homedir shell
55 johnh * 2274 134 John & Ampersand /home/johnh /bin/bash
56 greg * 2275 134 Greg < Lessthan /home/greg /bin/bash
57 root * 0 0 Root ; Semi /root /bin/bash
58 four * 1 1 Fourth Row /home/four /bin/bash
59
60 Command:
61 cat data.fsdb | db_to_csv -g 3
62
63 Output:
64 <table>
65 <tr><th>account</th> <th>passwd</th> <th>uid</th> <th>gid</th> <th>fullname</th> <th>homedir</th> <th>shell</th> </tr>
66 <tr bgcolor="#f0f0f0"><td>johnh</td> <td>*</td> <td>2274</td> <td>134</td> <td>John & Ampersand</td> <td>/home/johnh</td> <td>/bin/bash</td> </tr>
67 <tr bgcolor="#f0f0f0"><td>greg</td> <td>*</td> <td>2275</td> <td>134</td> <td>Greg < Lessthan</td> <td>/home/greg</td> <td>/bin/bash</td> </tr>
68 <tr bgcolor="#f0f0f0"><td>root</td> <td>*</td> <td>0</td> <td>0</td> <td>Root ; Semi</td> <td>/root</td> <td>/bin/bash</td> </tr>
69 <tr bgcolor="#d0d0d0"><td>four</td> <td>*</td> <td>1</td> <td>1</td> <td>Fourth Row</td> <td>/home/four</td> <td>/bin/bash</td> </tr>
70 </table>
71
73 Fsdb. dbcolneaten. dbfileadjust. html_table_to_db.
74
76 new
77 $filter = new Fsdb::Filter::db_to_html_table(@arguments);
78
79 Create a new db_to_html_table object, taking command-line arguments.
80
81 set_defaults
82 $filter->set_defaults();
83
84 Internal: set up defaults.
85
86 parse_options
87 $filter->parse_options(@ARGV);
88
89 Internal: parse command-line arguments.
90
91 _format_row
92 $self->_format_row($row_aref, $tag, $color);
93
94 Return as a string the HTML table row corresponding to @$row_aref, with
95 each element delimited by $tag, with color $color.
96
97 setup
98 $filter->setup();
99
100 Internal: setup, parse headers.
101
102 run
103 $filter->run();
104
105 Internal: run over each rows.
106
108 Copyright (C) 2007-2015 by John Heidemann <johnh@isi.edu>
109
110 This program is distributed under terms of the GNU general public
111 license, version 2. See the file COPYING with the distribution for
112 details.
113
114
115
116perl v5.32.1 2021-01-27 Fsdb::Filter::db_to_html_table(3)