Excel2Html 2.2.1.0
------------------
Written by Ath, as response to this Coding Snack request: http://www.donationcoder.com/forum/index.php?topic=25114.0

A command-line tool to transform an Excel file into 1, or several, html files, using all or part of the data in the sheet. The output html is created based on a template specified.

Change history:
---------------
v2.2.1.0 2012-05-10, Ath
* Replaced POI 3.8-beta3 by POI 3.8 release version.
v2.2.0.0 2012-03-06, Ath
+ Conditional filtering implementation started
v2.1.0.1 2012-03-06, Ath
! Fixed some typos
! Added new tags to -dt output
v2.1.0.0 2012-03-02, Ath
+ Added 2 new tags for looping over all rows of the excel sheet (as defined by the -r/-s/-m parameters) (suggestion by DeVamp)
+ Added an xml example for looping
* Readme updated for the new tags
v2.0.1.2 2011-07-27, Ath
+ Added excel2html.sh after some testing with Excel2Html on Ubuntu linux (should be set to executable to run directly)
* Updated readme accordingly for some linux differences
v2.0.1.1 2011-07-27, Ath
! Documented -sf parameter to enable ShowFormula, displaying [formula text] with the result of the formula (for testing)
+ Added -dt parameter to Display all Tags supported in the template
v2.0.1.0 2011-07-26, Ath
! Fixed issue with not handling formulas correctly, by replacing poi-ooxml-schemas-<version>.jar by ooxml-schemas-1.1.jar
v2.0.0.1 2011-07-26, Ath
* Improvements to the build scripts to automatically produce -nolib archive and publish.version archives
* Sets errorlevel to 1 when an error occurs, so the batch file can jump to a pause to keep the message in sight
* Sets errorlevel to 2 if something goes awry during processing of the Excel file to html file(s)
* Some minor source and javadoc improvements
v2.0.0.0 2011-07-25, Ath
- Release version after some more testing
v1.0.99.1 (beta for v2) 2011-07-25, Ath
+ Added exception handling for missing lib\*.jar files and a message what needs to be there
+ Added the display of an application banner, it's disabled by using -q parameter
+ Added Excel2Html.cmd to run application without specifying java -jar Excel2Html.jar, that also does some sanity checks
+ Updated and adapted Excel2Html.readme.txt for this Java release
! Fixed wrong html tags for table-header and -footer
! Fixed colspan tags for table-header and -footer
v1.0.99.0 (beta for v2) 2011-07-24, Ath
+ Command-line parsing added -0..-4 parameters
- Command-line parsing removed -et parameter
* Converter improved handling of formula cells
* Converter improved conversion of numerics
! Fixed bug with header always being included in output
+ Implemented multiple output files handling properly
+ Bumped version to exceed previous 1.x intended release.
v0.0.3.0 PoC 2011-07-22, Ath
+ Command-line parsing added -df parameter
+ Converter object properties, getters and setters done
+ Converter execute method implemented
v0.0.2.0 PoC 2011-07-17, Ath
+ Command-line parsing completed
v0.0.1.0 PoC 2011-07-16, Ath
+ Project layout in Eclipse, using proprietary Ant build scripts (won't be published)
+ Command-line parsing initial setup
+ Converter object initial setup
- All output shown goes to the console!
- Complete from-the-ground-up rewrite of Excel2Html.au3
v0.5.1.0 2011-07-12, Ath
- Originally written in AutoIt3, but because of trouble accessing the Excel object once loaded in memory, for v2 rewritten in Java using Apache POI (http://poi.apache.org/)

Future improvements:
--------------------
- User requests?

Installation:
-------------
- Unzip the Excel2Html-<version>.zip file (preserving directories, unpacking at least all .jar and .cmd/.sh files) into the desired location
- Assure Java 6 is installed and available through the Path (open a command prompt and type "java -version" (without the quotes) to verify.)
- Use (from a command prompt or created shortcut) the command (Windows:) "Excel2Html <parameters>" or (Linux:) "./excel2html.sh <parameters>" (without the quotes) using parameters as described below
- Linux only: For convenience make excel2html.sh executable, either by "chmod 755 excel2html.sh" or "chmod +x excel2html.sh", the file can be renamed to "excel2html" if desired

Acknowledgments:
----------------
- Used libraries:
- Apache POI 3.8-beta3 from : http://poi.apache.org
- ini4j 0.5.2 from : http://ini4j.sourceforge.net
- ooxml-schemas 1.1 (replacing poi-ooxml-schemas) from : http://mvnrepository.com

Command-line parameters:
------------------------
-?				: Help display, show a message with all parameters shortly explained. (Also when 0 parameters are supplied)
-d				: Debug log mode enabled, writes extra information to Excel2Html.log during processing. Setting in inifile: debug=1
-1 .. -4		: Debug log mode like -d enabled, log detail level 1 .. 4 set. Setting in inifile: debug=<n>
-d-				: Disable Debug log mode (default), to override debug=1 in the inifile
-0				: Disable debug mode, same as -d-
-f filename		: The excel file to read the data from. See also -fs parameter. Setting in inifile: excelfile=filename
				Example: -f testaddresses.xlsx
-fs sheet		: The sheet number to read to data from. By default sheet 1 is read. Setting in inifile: sheet=1
-t templatefile	: The html template file to read as source for the output. Default: Excel2Html-template.html. Setting in inifile: templatefile=Excel2Html-template.html
-o outputfile	: The file to write the output to. If a valid filename is specified, than alldata will be written to that file. Setting in inifile: outputfile=dump.html
				If  the specified name contains ? or * or [ then multifile mode is enabled, and a file for each datarow will be written. ? and * are replaced by the rownumber, [col] is replaced by the data of the column no. specified
				Examples:
				-o dump.html : All output is written to dump.html
				-o dump-*.html : Data is written to dump-1.html, dump-2.html, etc.
				-o dump-[1]_[2].html : Data (testaddresses.xlsx is assumed) is written to dump-Fred_Flintstone.html, dump-Barney_Rubble.html, etc.
				These parameters can be combined, so -o dump-*-[2].html would give dump-1-Flintstone.html, etc.
-rf "format"	: Specify the format-string (Java String.format parameters) to use for rownumber formatting as used in filenames. Default: %d  Setting in inifile: rowformat=%d
				Examples:
				-rf "%04d" : assuming -o dump-*.html was also specified, the filenames would be dump-0001.html, dump-0002.html, etc.
-df "format"	: Set the format used to convert date fields, default = "dd-MM-yyyy". Setting in inifile: dateformat=dd-MM-yyyy
				  Because the formatting can not be extracted correctly from the excel sheet (yet), this has to be set.
-hr				: Use first row as table headers. Setting in inifile: tableheadrow=1
-hr-			: Disable the use of first row as table headers, to override inifile setting. Setting in inifile: tableheadrow=0
-th "tableheaders"	: Set headers for each column in the data. Setting in inifile: tableheader=Firstname,Lastname,Address,Postal code,City,Telephone,E-mail
				A header can span 2 or more columns by specifying a vertical bar, and the no. of columns to span (using colspan)
				Example:
				-th "Name|2,Address,Postal code,City,Telephone,E-mail" : gives 1 header 'Name' over the Firstname and Lastname columns, and the rest of the headers over their corresponding datacolumns.
-tf "tablefooters"	: Set footers for each column in the data. Setting in inifile: tablefooter=Firstname,Lastname,Address,Postal code,City,Telephone,E-mail
				The same extra colspan parameter can be given to a footer.
				Example:
				-tf "End of data|7" : A wide footer displaying "End of data" across 7 columns
-r count		: Set the repeatcount of rows after which the footer (if defined) and header are inserted into the table. Only applicable with the TableRows marker (see below). Default: 0. Setting in inifile: repeatcount=0
-s [row]		: Startrow setting, the row to start the export of data from. Default if not specified: 1, default if no row specified: 2. Setting in inifile: startrow=0
-m maxrow		: Maxrow setting, the maximum row that is to be output to file, not the number of rows! Setting in inifile: maxrow=
-p "Page header"	: Set the text for the page header using PageHeader marker (see below). Setting in inifile: header=
-pf "Page footer"	: Set the text for the page footer using PageFooter marker (see below). Setting in inifile: footer=
-sf				: ShowFormula produces the formula text with the formula results. Only available from the command-line.
-dt				: DisplayTags displays the available template tags. Only available from the command-line.
-q				: Quiet mode, disable error messages and the startup banner. Setting in inifile: quiet=1
-q-				: Quiet mode disabled (default), re-enable any error messages and the banner. Setting in inifile: quiet=0

Commandline parameters override any setting made in the inifile.

Inifile settings:
-----------------
debug=			: Debug log mode, 0 = off, >= 1 = on, > 1 increases the output detail generated in the log.
excelfile=		: The excel file to read, specify including path and extension.
sheet=			: The sheet of the excel file to read. If specified, should be > 0 and < no. of sheets.
templatefile=	: The html template to use. Should be prepared with markers where the data should go. (See below)
outputfile=		: The html output file(s) to produce, see -o command-line parameter for details.
tableheadrow=	: Enable or disable the use of the first datarow as columnheaders. 0 = off, 1 = on
repeatcount=	: The no. of rows after which a tablefooter (if defined) and a tableheader is inserted. Either -hr or tableheadrow=1 should be specified to enable the use of columnheaders.
tableheader=	: The headers to display above each column. Only applicable with TableRows marker (see below), see also -th command-line parameter.
tablefooter=	: The footers to display below each column. Only applicable with TableRows marker (see below), see also -tf command-line parameter.
startrow=		: The row to start reading data, see -s command-line parameter.
maxrow=			: The last row to export to html.
rowformat=		: The format string to use when pasting the row number into the multiple file mode ? or * parameter.
dateformat=		: The format string used to convert dates, default set to dd-MM-yyyy.
header=			: The text to use for the PageHeader marker (see below)
footer=			: The text to use for the PageFooter marker (see below)
quiet=			: Enable or disable Quiet mode, 0 = off, 1 = on, set to 1 to suppress any error messageboxes.

Markers:
-----------------
Markers should be inserted into the html to place the data from Excel into the output. They are embeded as html comments, so if no data for a marker is available nothing is displayed.
These markers ARE case-sensitive!

PageHeader		= <!-- EXCEL2HTML - PAGE-HEADER -->		: The text specified with -p or header=
PageFooter		= <!-- EXCEL2HTML - PAGE-FOOTER -->		: The text specified with -pf or footer=
TableHeader		= <!-- EXCEL2HTML - TABLE-HEADER -->	: The complete <tr><th>header</th>...</tr> sequence is generated based on row 1, or -th or tableheader= parameters
TableRows		= <!-- EXCEL2HTML - TABLE-ROWS -->		: For use in Single File mode. All data is put in <tr><td>content</td>...</tr> tags, and ended with a NewLine. The majority of data will go here. See Excel2Html-all-template.html
TableFooter		= <!-- EXCEL2HTML - TABLE-FOOTER -->	: The complete <tr><th>footer</th>...</tr> sequence is generated based on -tf or tablefooter= parameters
TableColumn		= <!-- EXCEL2HTML - COLUMN <colnr> -->	: Data from column colnr is put where this tag is. The <tr><td></td></tr> has to be provided in the template, for maximum flexibility. See Excel2Html-1-template.html
														The <colnr> can be specified with or without spaces, so these are all valid:
														<!-- EXCEL2HTML - COLUMN1 -->
														<!-- EXCEL2HTML - COLUMN 2-->
														<!-- EXCEL2HTML - COLUMN3-->
														<!-- EXCEL2HTML - COLUMN 4 -->
LoopStart		= <!-- EXCEL2HTML - LOOP-START -->		: The tag to start looping over all rows in the excel sheet, same as TableRows, but now only the tags between LoopStart and LoopStop will be replaced with the data. Formatting is fully up to the user.
LoopStop		= <!-- EXCEL2HTML - LOOP-STOP -->		: End of loop definition, executes the replacement of values for the area between LoopStart and LoopEnd. These tags are placed by their lower-case counterparts, to avoid endless looping.
														  Multiple loops can be defined, but not nested loops!
														  Headers can be included both inside and outside a loop.

Now that Excel2Html is re-written in Java there are a few differences from the AutoIt3 version:
- The application is not compiled into an .exe, but delivered as a .jar, and requires at least Java runtime environment (JRE) version 6 installed.
- The lib directory contains the required Apache POI and ini4j .jar files, and should remain in the same relative location of Excel2Html.jar
- Error messages are displayed to the console, and no longer displayed as messageboxes. The -et parameter is no longer supported.
- Excel does not need to be installed on the computer that runs the conversion.
- Format strings should be specified for Java's String.format() http://download.oracle.com/javase/6/docs/api/java/util/Formatter.html#syntax
- Logging can be more extensively supplied, with log detail levels from 1 (-d/-1) up to 4 (-4)
