0
|
1 NAME
|
|
2 TextFilesToHTML.pl - Generate HTML table file(s) from TextFile(s)
|
|
3
|
|
4 SYNOPSIS
|
|
5 TextFilesToHTML.pl ... TextFile(s)...
|
|
6
|
|
7 TextFilesToHTML.pl [-a, --align left | center | right,[top | middle |
|
|
8 bottom]] [-b, --border borderwidth] [--cellpadding padding]
|
|
9 [--cellspacing spacing] [--footer string] [-d, --displaylinks top |
|
|
10 bottom | both] [--displaylinksinfo line | table | both] [-h, --help]
|
|
11 [--headeralign left | center | right,[top | middle | bottom]]
|
|
12 [--headercolor "#RRGGBB"] [--highlight
|
|
13 "fieldlabel,datatype,criterion,value,[fieldlabel,datatype,criterion,valu
|
|
14 e,]..."] [--highlightby colnum | collabel] [--highlightcolor
|
|
15 "#RRGGBB,#RRGGBB"] [--highlightstyle text | background] [--indelim comma
|
|
16 | semicolon] [-m, --mode plain | shade | highlight | shadedhighlight]
|
|
17 [-n, --numrows number] [-o, --overwrite] [-r, --root rootname]
|
|
18 [--stylesheet old | new | none] [--stylesheetname filename] [
|
|
19 --shadecolor "#RRGGBB,#RRGGBB"] [-t, --title string] [--titledisplay yes
|
|
20 | no] [-w, --workingdir dirname] TextFile(s)...
|
|
21
|
|
22 DESCRIPTION
|
|
23 Generate HTML file(s) from *TextFile(s)*. The HTML file(s) contain data
|
|
24 tables and appropriate navigational links to view other tables. These
|
|
25 files can be generated for local viewing or deployment on a web server.
|
|
26 A variety of options are provided to control style and appearence of
|
|
27 tables.
|
|
28
|
|
29 Multiple *TextFile(s)* names are separated by spaces. The valid file
|
|
30 extensions are *.csv* and *.tsv* for comma/semicolon and tab delimited
|
|
31 text files respectively. All other file names are ignored. All the text
|
|
32 files in a current directory can be specified by **.csv*, **.tsv*, or
|
|
33 the current directory name. The --indelim option determines the format
|
|
34 of *TextFile(s)*. Any file which doesn't correspond to the format
|
|
35 indicated by --indelim option is ignored.
|
|
36
|
|
37 OPTIONS
|
|
38 -a, --align *left | center | right,[top | middle | bottom]*
|
|
39 Horizontal and vertical alignment for table rows except for header
|
|
40 row which is specified using --headeralign option. Possible
|
|
41 horizontal alignment values: *left, center, or right*. Possible
|
|
42 vertical alignment values: *top, middle, or bottom*.
|
|
43
|
|
44 Default values: *left,middle*
|
|
45
|
|
46 -b, --border *borderwidth*
|
|
47 Table border width. Default value: 1 for *plain* and *highlight*
|
|
48 mode; 0 for *shade* and *shadedhightlight* mode. Zero indicates no
|
|
49 border.
|
|
50
|
|
51 --cellpadding *padding*
|
|
52 Table cell padding. Default value: *2*.
|
|
53
|
|
54 --cellspacing *spacing*
|
|
55 Table cell spacing. Default value: *1*.
|
|
56
|
|
57 --footer *string*
|
|
58 Text string to be included at bottom of each HTML file. Default:
|
|
59 none.
|
|
60
|
|
61 -d, --displaylinks *top | bottom | both*
|
|
62 Specify where to display navigation links in each HTML file for
|
|
63 accessing all other HTML files. Possible values: *top, bottom, or
|
|
64 both*. Default value: *both*. This option is only valid during
|
|
65 multiple HTML files generation for an input file.
|
|
66
|
|
67 --displaylinksinfo *line | table | both*
|
|
68 Control display of additional information along with navigational
|
|
69 links: Showing line n of m is displyed for line and showing table n
|
|
70 of m for table. Possible values: *line | table | both*. Default:
|
|
71 *both*. This option is only valid during multiple HTML files
|
|
72 generation.
|
|
73
|
|
74 -h, --help
|
|
75 Print this help message
|
|
76
|
|
77 --headeralign *left | center | right,[top | middle | bottom]*
|
|
78 Horizontal and vertical alignment for table header rows. Possible
|
|
79 horizontal alignment values: *left, center, or right*. Possible
|
|
80 vertical alignment values: *top, middle, or bottom*.
|
|
81
|
|
82 Default values: *center,middle*
|
|
83
|
|
84 --headercolor *"#RRGGBB"*
|
|
85 Color used to fill background of table header row containing column
|
|
86 labels represented as a hexadecimal string. None for -m, --mode
|
|
87 option value of *plain* and *#ccccff*, light blue, for others.
|
|
88
|
|
89 --highlight
|
|
90 *"fieldlabel,datatype,criterion,value,[fieldlabel,datatype,criterion,val
|
|
91 ue,]..."*
|
|
92 This value is mode specific. It specifies how to highlight various
|
|
93 column values for each text file. Same set of quartets values are
|
|
94 applied to all *TextFile(s)*.
|
|
95
|
|
96 For *highlightbycolnum* mode, input text format contains these
|
|
97 quartets: *colnum,datatype,criterion,value,...*. Possible datatype
|
|
98 values: *numeric or text*. Possible criterion values: *le, ge, or
|
|
99 eq*. Examples: "1,numeric,le,450>" or
|
|
100 "2,numeric,ge,150,6,numeric,le,10".
|
|
101
|
|
102 For *highlightbycollabel* mode, input text format contains these
|
|
103 quartets: *collabel,datatype,criterion,value,...*.
|
|
104
|
|
105 --highlightby *colnum | collabel*
|
|
106 This value is mode specific. It indicates how columns to be
|
|
107 highlighted are specified using --hightlight option. Possible
|
|
108 values: *colnum or collabel*. Default value: *colnum*.
|
|
109
|
|
110 --highlightcolor *"#RRGGBB,#RRGGBB"*
|
|
111 Colors used to highlight column values during *highlight* and
|
|
112 *shadedhightlight* mode represented as hexadecimal strings.
|
|
113
|
|
114 For --highlighstyle option values of *text* and *background*, these
|
|
115 colors represent text or background colors respectively. For a
|
|
116 specific column, first color string is used for values which meet
|
|
117 criterion indicated by --highlight option; the second color is used
|
|
118 for rest of the values.
|
|
119
|
|
120 Default values for *background* --highlightstyle: *#0fff0f,#ff0f0f*.
|
|
121 And default values for *text* --highlightstyle: *#0fbb0f,#ff0f0f*.
|
|
122 Hexadecimal strings for both --highlightstyle colors correspond to
|
|
123 *reddish* and *greenish*.
|
|
124
|
|
125 --highlightstyle *text | background*
|
|
126 This value is mode specific. It indicates highlight style used to
|
|
127 differentiate column values which pass a specified criterion from
|
|
128 others. Possible values: *text or background*. Default:
|
|
129 *background*.
|
|
130
|
|
131 --indelim *comma | semicolon*
|
|
132 Input delimiter for CSV *TextFile(s)*. Possible values: *comma or
|
|
133 semicolon*. Default value: *comma*. For TSV files, this option is
|
|
134 ignored and *tab* is used as a delimiter.
|
|
135
|
|
136 -m, --mode *plain | shade | highlight | shadedhighlight*
|
|
137 Specify how to generate HTML table(s): plain tables with line
|
|
138 borders, background of alternate rows filled with a specified color,
|
|
139 column values hightlighted using a specified criteria, or
|
|
140 combination of previous two styles.
|
|
141
|
|
142 Possible values: *plain, shade, highlight, or shadedhighlight*.
|
|
143 Default: *shade*.
|
|
144
|
|
145 -n, --numrows *number*
|
|
146 Maximum number of rows per table. Default value: *100*. Use 0 to put
|
|
147 all rows into one table. For *TextFile(s)* with more than maximum
|
|
148 number of specified rows, multiple HTML tables, with appropriate
|
|
149 navigation links, are created.
|
|
150
|
|
151 -o, --overwrite
|
|
152 Overwrite existing files.
|
|
153
|
|
154 -r, --root *rootname*
|
|
155 New file or directory name is generated using the root: <root>.html
|
|
156 or <root>-html. Default new file name: <InitialTextFileName>.html.
|
|
157 Default directory name: <InitialTextFileName>-html.
|
|
158
|
|
159 For *TextFile(s)* with more than maximum number of rows specified
|
|
160 per table, this directory tree is generated using <Name> where
|
|
161 <Name> corresponds to <root> or <InitialTextFileName>:Top dir -
|
|
162 <Name>-html; Sub dirs - html and mols. <Top dir> contains
|
|
163 <Name>.html and <Name>.css files and <sub dir> html conatins various
|
|
164 <Name>Lines<Start>To<End>.html files; <sub dir> mols is created as
|
|
165 needed and contains
|
|
166
|
|
167 This option is ignored for multiple input files.
|
|
168
|
|
169 --stylesheet *old | new | none*
|
|
170 Controls usage of stylesheet for newly generated HTML file(s).
|
|
171 Possible values: *old, new, or none*. Default value: *new*.
|
|
172
|
|
173 Stylesheet file contains various properties which control apperance
|
|
174 of HTML pages: type, size, and color of fonts; background color; and
|
|
175 so on.
|
|
176
|
|
177 For *old* value, an existing stylesheet file specified by
|
|
178 --stylesheetname option is used for each HTML file; no new
|
|
179 stylesheet file is created. This option is quite handy for deploying
|
|
180 HTML file(s) on a web server: assuming you specify a valid
|
|
181 stylesheet file location relative to your WWWRoot, a reference to
|
|
182 this stylesheet is added to each HTML file. For local deployment of
|
|
183 HTML file(s), a complete path to a local stylesheet is fine as well.
|
|
184
|
|
185 For *create* value, a new stylesheet is created and reference to
|
|
186 this local stylesheet is added to each HTML file. Use option
|
|
187 --stylesheetname to specify name.
|
|
188
|
|
189 For *none* value, stylesheet usage is completely ignored.
|
|
190
|
|
191 --stylesheetname *filename*
|
|
192 Stylesheet file name to be used in conjunction with -s --stylesheet
|
|
193 option. It is only valid for *old* value of -s --stylesheet option.
|
|
194 Specify a valid stylesheet file location relative to your WWWRoot
|
|
195 and a reference to this stylesheet is added to each HTML file.
|
|
196 Example: "/stylesheets/MyStyleSheet.css". Or a complete path name to
|
|
197 a local stylesheet file.
|
|
198
|
|
199 For *create* value of -s --stylesheet option, a new stylesheet file
|
|
200 is created using -r --root option. And value of --stylesheetname is
|
|
201 simply ignored.
|
|
202
|
|
203 --shadecolor *"#RRGGBB,#RRGGBB"*
|
|
204 Colors used to fill background of rows during *shade* and
|
|
205 *shadedhightlight* mode represented as a pair of hexadecimal string;
|
|
206 the first and second color values are used for odd and even number
|
|
207 rows respectively.
|
|
208
|
|
209 Default value: *"#ffffff,#e0e9eb"* - it's white and very light blue
|
|
210 for odd and even number rows.
|
|
211
|
|
212 -t, --title *string*
|
|
213 Title for HTML table(s). Default value: <TextFileName>. For multiple
|
|
214 input files, -r --root option is used to generate appropriate
|
|
215 titles.
|
|
216
|
|
217 --titledisplay *yes | no*
|
|
218 Display title for HTML table(s). Possible values: *yes or no*.
|
|
219 Default value: *yes*.
|
|
220
|
|
221 -w, --workingdir *dirname*
|
|
222 Location of working directory. Default: current directory.
|
|
223
|
|
224 EXAMPLES
|
|
225 To generate HTML tables with rows background filled with white and
|
|
226 greyish colors and navigation links on top and botton of each page,
|
|
227 type:
|
|
228
|
|
229 % TextFilesToHTML.pl -o Sample1.csv
|
|
230
|
|
231 To generate HTML tables with rows background filled with golden and
|
|
232 greyish colors, navigation links on top and botton of each page, 10 rows
|
|
233 in each table, greyish header row color, and cell spacing of 1, type:
|
|
234
|
|
235 % TextFilesToHTML.pl -o -n 10 --headeralign "center" --headercolor
|
|
236 "#a1a1a1" --shadecolor "#ddd700,#d1d1d1" --cellspacing 1
|
|
237 Sample1.csv
|
|
238
|
|
239 To generate plain HTML tables with 10 rows in each table and navigation
|
|
240 links only at the bottom, type:
|
|
241
|
|
242 % TextFilesToHTML.pl -o -n 10 --displaylinks bottom -m plain
|
|
243 Sample1.csv
|
|
244
|
|
245 To highlight values in column 3 using specified highlight criteria and
|
|
246 fill in default background colors, type:
|
|
247
|
|
248 % TextFilesToHTML.pl -n 10 --highlight "3,numeric,le,450"
|
|
249 --highlightby colnum --highlightstyle background -m
|
|
250 shadedhighlight -o Sample1.csv
|
|
251
|
|
252 To highlight values in column MolWeight using specified highlight
|
|
253 criteria, color the text using default colors, and add a footer message
|
|
254 in every page, type:
|
|
255
|
|
256 % TextFilesToHTML.pl -n 4 --highlight "MolWeight,numeric,le,500"
|
|
257 --highlightby collabel --highlightstyle text -m shadedhighlight -o
|
|
258 --footer "Copyright (C) MayaChemTools" --cellspacing 1 Sample1.csv
|
|
259
|
|
260 AUTHOR
|
|
261 Manish Sud <msud@san.rr.com>
|
|
262
|
|
263 SEE ALSO
|
|
264 JoinTextFiles.pl, MergeTextFilesWithSD.pl, ModifyTextFilesFormat.pl,
|
|
265 SplitTextFiles.pl, SortTextFiles.pl
|
|
266
|
|
267 COPYRIGHT
|
|
268 Copyright (C) 2015 Manish Sud. All rights reserved.
|
|
269
|
|
270 This file is part of MayaChemTools.
|
|
271
|
|
272 MayaChemTools is free software; you can redistribute it and/or modify it
|
|
273 under the terms of the GNU Lesser General Public License as published by
|
|
274 the Free Software Foundation; either version 3 of the License, or (at
|
|
275 your option) any later version.
|
|
276
|