Text Tools

This is a collection of text formatting tools which covers column delimited, tab delimited, CSV (comma separated values) as well as HTML tables and XML.

The following diagram illustrates the conversion paths possible with one or more combinations of utilities. Most of the tools are CSV centric as this is the most readily available format.

Col2Tab Col2Csv Html2Csv & Csv2Html Csv2Tab & Tab2Csv Csv2Xml & Xml2Csv

Program

Function

Col2Csv Column delimited to CSV delimited file conversion tool.
Col2Tab Column delimited to Tab delimited file conversion tool.
Csv2Tab CSV delimited to Tab delimited file conversion tool.
Tab2Csv Tab delimited to CSV delimited file conversion tool.
Csv2Html CSV delimited to HTML table file conversion tool.
Html2Csv HTML table to CSV delimited file conversion tool.
Csv2Xml CSV delimited to XML file conversion tool.
Xml2Csv XML file to CSV delimited file conversion tool.

Text Tools Version 2.1 - Installation program - (Size 2,419 KB) Shareware
Text Tools Version 2.1 - Zipped files only (no install program) - (Size 2,314 KB) Shareware
Buy all 8 tools for AU$20

Top

Installation:

If you have downloaded the installation program (.EXE file) then simply run it and it will guide you through the installation process.

Otherwise, if you prefer to extract and install the files yourself (.ZIP file) then you can extract the file into a directory anywhere on your PC. So that the program can be called from anywhere, please ensure that the path to directory is included in the Path system environment settings.

Top

Col2Csv:

Column delimited to CSV delimited file conversion tool.

Usage: Col2Csv <input file> <output file> <column nums>
               [/Delimiter <x>] [/QuoteChar <x>] [/I]

       <input file>   Column delimited source file.
       <output file>  Destination file.
       <column nums>  List of comma separated numbers indicating starting
                      positions for each column of data. No spaces allowed.
       /Delimiter <x> Delimiter used to separate data columns (Default ,)
       /QuoteChar <x> Character used to enclose strings (Default ")
       /I             Ignore the first line (header) in the input file.	  

eg. 1 Col2Csv input.txt output.csv 5,17,45,55
eg. 2 Col2Csv "source file.txt" "c:\temp\output.csv" 7,19,21,49 /Delimiter "|"

Top

Col2Tab:

Column delimited to Tab delimited file conversion tool.

Usage: Col2Tab <input file> <output file> <column nums> [/I]

       <input file>  Column delimited source file.
       <output file> Destination file.
       <column nums> List of comma separated numbers indicating starting
                     positions for each column of data. No spaces allowed.
       /I            Ignore the first line (header) in the input file.

eg. 1 Col2Tab input.txt output.txt 5,17,45,55
eg. 2 Col2Tab "source file.txt" "c:\temp\output.tab" 7,19,21,49,73

Top

Csv2Tab:

CSV delimited to Tab delimited file conversion tool.

Usage: Csv2Tab <input file> <output file>
               [/Delimiter <x>] [/QuoteChar <x>] [/I]

  <input file>    CSV input file.
  <output file>   Output tab delimited file.
  /Delimiter <x>  Delimiter used to separate data cols in CSV file. (Default ,)
  /QuoteChar <x>  Character used to enclose strings in CSV file. (Default ")
  /I              Ignore the first line (header) in the input file.

eg. 2 Csv2Tab "c:\temp\input file.csv" output.txt
eg. 3 Csv2Tab input.csv output.txt /Delimiter "|"

Top

Tab2Csv:

Tab delimited to CSV delimited file conversion tool.

Usage: Tab2Csv <input file> >output file>
               [/Delimiter <x>] [/QuoteChar <x>] [/I]

       <input file>   Tab delimited source file.
       <output file>  CSV delimited destination file.
       /Delimiter <x> Delimiter used to separate data columns (Default ,)
       /QuoteChar <x> Character used to enclose strings (Default ")
       /I             Ignore the first line (header) in the input file.

eg. 1 Tab2Csv input.txt output.csv
eg. 2 Tab2Csv "c:\temp\source file.txt" output.csv
eg. 3 Tab2Csv input.txt output.csv /Delimiter "|"

Top

Csv2Html:

CSV delimited to HTML table file conversion tool.
Creates a HTML file made up of a table based upon the contents of a CSV file.

Usage: Csv2Html <input file> <output file> [/F <format file>]
                [/Delimiter <x>] [/QuoteChar <x>] [/I]

  <input file>     CSV input file.
  <output file>    HTML output file.
  /F <format file> Optional INI file used to format the table. Allows you to
                   specify meta tag and cascading style sheet which gives you
                   greater control over the table display properties.
  /Delimiter <x>   Delimiter used to separate data columns. (Default ,)
  /QuoteChar <x>   Character used to enclose strings (Default ")
  /I               Ignore the first line (header) in the input file.

eg. 1 Csv2Html input.csv output.htm
eg. 2 Csv2Html input.csv output.htm /F Csv2Html.ini /QuoteChar '
eg. 3 Csv2Html "c:\temp\source file.csv" output.htm /F Csv2Html.ini

Default format files are created when you first run Csv2Html.exe
These files are Csv2Html.ini and Csv2Html.css which give you greater control over the table display properties. Use of these files is optional.

Csv2Html.ini Format File:
This file allows you to turn on or off certain properties of the HTML file:
UseTitle = Use title defined below. (0=No, 1=Yes, Default=1)
Title = Title of output HTML file.
UseMetaTag = Use META tag defined below. (0=No, 1=Yes, Default=1)
MetaTag = META tag (See http://www.w3.org/TR/html401/struct/global.html)
UseCascadingStyleSheet = Use CSS file defined below. (0=No, 1=Yes, Default=1)
CascadingStyleSheetFile = File name of CSS file. (Default Csv2Html.css)

Csv2Html.css Cascading Style Sheet File:
This file defines how the table is formatted. It controls font type colour and size as well as background colour.
You can do a whole lot more. For more info see http://www.w3.org/Style/CSS/

Top

Html2Csv:

HTML table to CSV delimited file conversion tool.
Only one table per HTML file allowed.
All cells must be specified, ie. empty cells must be bounded by <td></td> tags.

Usage: Html2Csv <input file> <output file>
                [/Delimiter <x>] [/QuoteChar <x>] [/I]

  <input file>     HTML input file.
  <output file>    CSV output file.
  /Delimiter <x>   Delimiter used to separate data columns. (Default ,)
  /QuoteChar <x>   Character used to enclose strings (Default ")
  /I               Ignore the first table row (header) in the input file.

eg. 1 Html2Csv input.htm output.csv
eg. 2 Html2Csv "c:\temp\source file.htm output.csv
eg. 3 Html2Csv "c:\temp\source file.htm output.csv /Delimiter "|"

Top

Csv2Xml:

CSV delimited to XML file conversion tool.
Creates an XML file based upon the contents of a CSV file.

Usage: Csv2Xml <input file> <output file> [/CSS <css file>]
               [/Delimiter <x>] [/QuoteChar <x>] [/I]

  <input file>    CSV input file.
  <output file>   XML output file.
  /CSS <css file> Optional reference to a cascading style sheet file.
                  The file may be .CSS or .XSL types.
  /Delimiter <x>  Delimiter used to separate data cols in CSV file (Default ,)
  /QuoteChar <x>  Character used to enclose strings in CSV file (Default ")
  /I              Ignore the first line (header) in the input file.

eg. 1 Csv2Xml input.csv output.xml
eg. 2 Csv2Xml input.csv output.xml /CSS Csv2Xml.xsl
eg. 3 Csv2Xml "c:\temp\source file.csv" output.xml /Delimiter "|"

Top

Xml2Csv:

XML file to CSV delimited file conversion tool.
XML file must be standard format which must include all nodes in each row.

Usage: Xml2Csv <input file> <output file> <root element>
               [/Delimiter <x>] [/QuoteChar <x>]

<input file>   The name of the input XML file.
<output file>  The name of the output CSV delimited file.
<root element> The name of the node which indicates the start of the table.
/Delimiter <x> Delimiter used to separate data columns. (Default ,)
/QuoteChar <x> Character used to enclose strings (Default ")

eg. 1 Xml2Csv input.xml output.csv table
eg. 2 Xml2Csv "c:\temp\source file.xml" output.csv table
eg. 3 Xml2Csv input.xml output.csv table /Delimiter "|"

Top

Return Codes:

All the above programs return a code indicating whether the conversion has passed or failed.

The following batch file is an example of how to use return codes:

@echo off
Col2Csv a.txt b.csv 10,28,46,76,86,91,101
echo ErrorLevel = %errorlevel%
if %errorlevel%==0 goto SUCCESS
if %errorlevel%==1 goto FAILURE
goto END


:SUCCESS
echo SUCCESS
goto END


:FAILURE
echo FAILURE
goto END


:END
pause
Text Tools Version 2.1 - Installation program - (Size 2,419 KB) Shareware
Text Tools Version 2.1 - Zipped files only (no install program) - (Size 2,314 KB) Shareware
Buy all 8 tools for AU$20