public final class LinesToCSV
extends java.lang.Object
Constructor and Description |
---|
LinesToCSV(java.io.File file,
int grouping,
char separatorChar,
char quoteChar,
char commentChar,
java.lang.String encoding)
convert a txt file to CSV, constructor.
|
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
Simple command line interface to LinesToCSV.
|
public LinesToCSV(java.io.File file, int grouping, 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.grouping
- how many lines to collect together as one csv line, one field per line.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.commentChar
- char to use to introduce comments. Use (char) 0 if none. Only one character allowed.
Note this is a 'char' not a "string". For output file. No comment presumed in input file.encoding
- encoding of input and output file.java.io.IOException
- if problems reading/writing filepublic static void main(java.lang.String[] args)
args
- name of csv file to remove excess quotes and space