com.mindprod.csv
Class CSVDeEntify
java.lang.Object
com.mindprod.csv.CSVDeEntify
public final class CSVDeEntify
- extends java.lang.Object
convert entities in selected columns back to UTF-8 characters.
Use: java.exe com.mindprod.CSVDeEntify somefile.csv 0 3
- Since:
- 2011-01-24
- Version:
- 1.2 2011-02-15 rename from StripEntities to CSVDeEntify.
- Author:
- Roedy Green, Canadian Mind Products
Constructor Summary |
CSVDeEntify(java.io.File file,
char separatorChar,
char quoteChar,
char commentChar,
java.lang.String encoding,
int... colsToStrip)
convert entities to UTF-8 in selected columns in a CSV file, constructor. |
Method Summary |
static void |
main(java.lang.String[] args)
Simple command line interface to strip entities from selected columns in a CSV file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CSVDeEntify
public CSVDeEntify(java.io.File file,
char separatorChar,
char quoteChar,
char commentChar,
java.lang.String encoding,
int... colsToStrip)
throws java.io.IOException
- convert entities to UTF-8 in selected columns in a CSV file, constructor. Just create the CSVDeEntify object.. There are no methods to call.
- Parameters:
file
- CSV file to have entities strippedseparatorChar
- 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.colsToStrip
- list of columns wanted to have entities stripped.
- Throws:
java.io.IOException
- if problems reading/writing file
main
public static void main(java.lang.String[] args)
- Simple command line interface to strip entities from selected columns in a CSV file.
Must have extension .csv
Use java com.mindprod.CSVDeEntify 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 strip, followed by zero-based cols wanted in desired order.