com.mindprod.csv
Class CSVTemplate

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

public final class CSVTemplate
extends java.lang.Object

Expands a CSV file to boilerplate in a text file.

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

Since:
2011-02-14
Version:
1.1 2011-03-07 output file how has same extension as the template.
Author:
Roedy Green, Canadian Mind Products

Constructor Summary
CSVTemplate(java.io.File readFile, java.io.File writeFile, java.lang.String template, char separatorChar, char quoteChar, java.lang.String commentChars, java.lang.String encoding)
          Constructor to Expand a CSV file to boilerplate in a text file.
 
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

CSVTemplate

public CSVTemplate(java.io.File readFile,
                   java.io.File writeFile,
                   java.lang.String template,
                   char separatorChar,
                   char quoteChar,
                   java.lang.String commentChars,
                   java.lang.String encoding)
            throws java.io.IOException
Constructor to Expand a CSV file to boilerplate in a text file.

Parameters:
readFile - CSV file containing data to insert into the template.
writeFile - Where the expanded templates are written.
template - The string include %n to select 0-based cols, possibly multiline.
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.
Throws:
java.io.IOException - if problems reading/writing file
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
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
Throws:
java.io.IOException - if trouble reading the template.