HTML_TABLE_TO_DB(1)
π HTML_TABLE_TO_DB β a Perl user-contributed manual page, bestie π
okay so you found html_table_to_db, and honestly? she's iconic. this is one of the user-contributed Perl doc pages (perl v5.32.1 energy, we'll get to that at the end π«Ά), and she does exactly one thing and does it beautifully: she takes an HTML table and turns it into fsdb. that's it. that's the gig. πΈ
β¨ NAME β¨
html_table_to_db β convert HTML tables into fsdb π
π SYNOPSIS π
html_table_to_db <source.html >dest.fsdb
like, pipe in, pipe out, no drama. periodt. π
π¦ DESCRIPTION π¦
okay so first things first: this bad boy converts a HTML table to Fsdb format. π
the input is an HTML table β not fsdb, bestie, do not come in here with fsdb, that's not what we do. where do the column names come from? you have options, literally:
- if there are
THelements, the column names come from those β¨ - if there are no such elements, they get defined as
column0throughcolumnN(yes, really, that's the fallback, she's doing her best π)
the output is two-space-separated fsdb. and ngl, the manpage itself says it: (Someday more general field separators should be supported.) β so like, manifesting that for future us π―οΈ. also, fsdb fields are a normalized version of the HTML file: multiple spaces are compressed to one. no cap. π―
this module also supports the standard fsdb options, let's go π₯:
-dβ enable debugging output. turn it on, see the vibes. π-ior--inputInputSource β read from InputSource, which is typically a file name, or-for standard input, or (if you're in Perl π)IO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects.-oor--outputOutputDestination β write to OutputDestination, typically a file name, or-for standard output, or (if you're in Perl π)IO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects.--autorunor--noautorunβ by default, programs process automatically, butFsdb::Filterobjects in Perl do not run until you invoke therun()method. the--(no)autorunoption controls that behavior within Perl. main character energy only when you call her. π--helpβ show help. bless. π«Ά--manβ show full manual. hi, you are here. π
π SAMPLE USAGE π
πΈ Input:
<table>
<tr><th>account</th> <th>passwd</th> <th>uid</th> <th>gid</th> <th>fullname</th> <th>homedir</th> <th>shell</th> </tr>
<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>
<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>
<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>
<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>
</table>
π Command:
html_table_to_db
π§ Output:
#fsdb -F S account passwd uid gid fullname homedir shell
johnh * 2274 134 John & Ampersand /home/johnh /bin/bash
greg * 2275 134 Greg < Lessthan /home/greg /bin/bash
root * 0 0 Root ; Semi /root /bin/bash
four * 1 1 Fourth Row /home/four /bin/bash
see how & became & and < became <? and how everything's two-space-separated? chef's kiss ππ she ate.
β SEE ALSO β
Fsdb.db_to_html_table. (yes, the reverse queen, go say hi π)
π AUTHOR and COPYRIGHT π
Copyright (C) 1991-2015 by John Heidemann <johnh@isi.edu> π«Ά
This program is distributed under terms of the GNU general public license, version 2. See the file COPYING with the distribution for details. (fr fr, read the license, it's the rules π)
okay and for the cute sign-off: this little masterpiece is perl v5.32.1, dated 2024-08-02, filed under HTML_TABLE_TO_DB(1) β and that's the whole vibe check, bestie. go convert some tables. ily. πβ¨π
π¦ where this page comes from
- epel 9: perl-Fsdb 2:3.9-1.el9 Β· GPLv2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms