com.mindprod.csv
Class CSVEntify

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

public final class CSVEntify
extends java.lang.Object

convert awkward UTF-9 characters in selected columns to é or ¤ style HTML entities.

Use: java.exe com.mindprod.CSVEntify somefile.csv 0 3

Since:
2011-01-24
Version:
1.0 2011-01-24 initial version
Author:
Roedy Green, Canadian Mind Products

Constructor Summary
CSVEntify(java.io.File file, char separatorChar, char quoteChar, char commentChar, java.lang.String encoding, int... colsToEntify)
          convert awkward characters in selected columns in a CSV file to entities, constructor.
 
Method Summary
static void main(java.lang.String[] args)
          Simple command line interface to CSVEntify.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVEntify

public CSVEntify(java.io.File file,
                 char separatorChar,
                 char quoteChar,
                 char commentChar,
                 java.lang.String encoding,
                 int... colsToEntify)
          throws java.io.IOException
convert awkward characters in selected columns in a CSV file to entities, constructor. Just create the CSVEntify object.. There are no methods to call.

Parameters:
file - CSV file to have awkward chars converted to HTML entities.
separatorChar - field separator character, usually ',' in North America, ';' in Europe and sometimes '\t' for tab.
quoteChar - char to use to enclose fields containing a separator, usually '\"'. Use (char)0 if you don't want a quote character.
commentChar - char to use to introduce comments. Use (char) 0 if none. Only one character allowed.
encoding - encoding of the input and output file.
colsToEntify - list of columns wanted to have chars converted to entities.
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 CSVEntify. Entifies selected columns in one csv file whose name is on the command line. Must have extension .csv
Use java com.mindprod.CSVEntify somefile.csv 0 1 2 3 ... Output replaces input. If you want the input, make a copy first.

Parameters:
args - name of csv file to entify, followed by zero-based cols to process in desired order.