public final class CSVTuple
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static java.util.regex.Pattern |
SPLITTER
used to split Label comment fields apart
|
Constructor and Description |
---|
CSVTuple(java.io.File file,
char separatorChar,
char quoteChar,
char commentChar,
int tupleLength,
java.lang.String encoding)
break a CSV file into tuples, constructor.
|
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
Simple command line interface to CSVTuple to brake a csv file into fixed length tuples.
|
(package private) static java.lang.String |
rebuildLabelComment(java.lang.String comment,
int tupleLength)
comment has two lead comment chars, one stripped off, and are used to label the fields.
|
static final java.util.regex.Pattern SPLITTER
public CSVTuple(java.io.File file, char separatorChar, char quoteChar, char commentChar, int tupleLength, java.lang.String encoding) throws java.io.IOException
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.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.tupleLength
- how many fields you want in each output record.encoding
- encoding of input and output.java.io.IOException
- if problems reading/writing filestatic java.lang.String rebuildLabelComment(java.lang.String comment, int tupleLength)
comment
- field names separated by commas, with lead comment char.public static void main(java.lang.String[] args)
args
- name of csv file r followed the desired length in fields of the fixed length tuples