public final class CSVSort
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) class |
CSVSort.SortableCSVRow |
Constructor and Description |
---|
CSVSort(java.io.File file,
int[] sortCols,
char[] sortTypes,
boolean[] isAscendings,
char separatorChar,
char quoteChar,
char commentChar,
java.lang.String encoding)
Sort a CSV file, constructor.
|
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
Simple command line interface to CSVSort, Sorts one csv file whose name is on the command line.
|
public CSVSort(java.io.File file, int[] sortCols, char[] sortTypes, boolean[] isAscendings, char separatorChar, char quoteChar, char commentChar, java.lang.String encoding) throws java.io.IOException
file
- CSV file to be packed to remove excess space and quotes.sortCols
- array of 0-based cols to sort on.sortTypes
- array of chars with letters s i n x to tell how to sort each column.isAscendings
- array of sort direction, true=ascending, false = descending.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 for input and output.java.io.IOException
- if problems reading/writing file