com.mindprod.csv
Class CSVToTable

java.lang.Object
  extended by com.mindprod.csv.CSVToTable

public final class CSVToTable
extends java.lang.Object

Converts a CSV file to the guts of an HTML table. Output appears in xxx.html.

Use: java.exe com.mindprod.CSVToTable xxx.csv Awkward characters will appear as Entities.

Since:
2011-01-23
Version:
1.2 2011-02-14 no longer entify. Do separately with Entify.
Author:
Roedy Green, Canadian Mind Products

Constructor Summary
CSVToTable(java.io.File file, char separatorChar, char quoteChar, java.lang.String commentChars, java.lang.String encoding, java.lang.String... cssClasses)
          Constructor to convert a CSV file to an HTML table.
 
Method Summary
static void main(java.lang.String[] args)
          Simple command line interface to CSVToTable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVToTable

public CSVToTable(java.io.File file,
                  char separatorChar,
                  char quoteChar,
                  java.lang.String commentChars,
                  java.lang.String encoding,
                  java.lang.String... cssClasses)
           throws java.io.IOException
Constructor to convert a CSV file to an HTML table.

Parameters:
file - CSV file to be packed to remove excess space and quotes.
separatorChar - field separator character, usually ',' in North America, ';' in Europe and sometimes '\t' for tab for the output file. It is tab for the input file. Note this is a 'char' not a "string".
quoteChar - character used to quote fields containing awkward chars.
commentChars - characters to treat as comments.
encoding - encoding of the input and output file.
cssClasses - css Classes for columns of HTML table (optional)
Throws:
java.io.IOException - if problems reading/writing file
Method Detail

main

public static void main(java.lang.String[] args)
Simple command line interface to CSVToTable. Converts one CSV file to an HTML table. Must have extension .csv
Use java com.mindprod.CSVToTable somefile.csv. You may optionally provide CSS classes for each column of the table. "" means no css class for that column. You can use CSVToTable constructor in your own programs.

Parameters:
args - name of csv file to remove excess quotes and space