com.mindprod.csv
Class CSVCondense
java.lang.Object
com.mindprod.csv.CSVCondense
public final class CSVCondense
- extends java.lang.Object
Remove blank lines and condense multiple spaces to one within fields. Trim lead and trail blanks on fields.
Use: java.exe com.mindprod.CSVCondense somefile.csv
- Since:
- 2011-02-08
- Version:
- 1.1 2011-02-17 tidy up the label comment
- Author:
- Roedy Green, Canadian Mind Products
Constructor Summary |
CSVCondense(java.io.File file,
char separatorChar,
char quoteChar,
char commentChar,
java.lang.String encoding)
Condense a CSV file, constructor. |
Method Summary |
static void |
main(java.lang.String[] args)
Simple command line interface to CSVCondense Condenses csv file whose name is on the command line. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CSVCondense
public CSVCondense(java.io.File file,
char separatorChar,
char quoteChar,
char commentChar,
java.lang.String encoding)
throws java.io.IOException
- Condense a CSV file, constructor. Just create. There are no methods to call.
- Parameters:
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.encoding
- encoding of input and output file.
- Throws:
java.io.IOException
- if problems reading/writing file
main
public static void main(java.lang.String[] args)
- Simple command line interface to CSVCondense Condenses csv file whose name is on the command line. Must have
extension .csv
Use java com.mindprod.CSVCondense somefile.csv
- Parameters:
args
- name of csv file to remove excess space and blank lines