Package com.logicaldoc.util.csv
Class CSVFile
java.lang.Object
com.logicaldoc.util.csv.CSVFile
- Direct Known Subclasses:
- CSVFileReader,- CSVFileWriter
CSVFile is a class used to handle Comma-Separated Values files.
 
It is abstract because it is the base class used for CSVFileReader and CSVFleWriter so you should use one of these (or both) according on what you need to do.
Example of usage:
 import java.util.*;
 import java.io.*;
 public class CSVFileExample {
        public static void main(String[] args) throws FileNotFoundException,IOException {
                CSVFileReader in = new CSVFileReader("csv_in.txt", ';', '"');
                CSVFileWriter out = new CSVFileWriter("csv_out.txt", ',', '\'');
     Vector<String> fields = in.readFields();
     while(fields!=null) {
       out.writeFields(fields);
       fields = in.readFields();
     }
     in.close();
     out.close();
  }
 }
 - Since:
- 8.1
- 
Method SummaryModifier and TypeMethodDescriptioncharGet the current field separator.charGet the current text qualifier.voidsetFieldSeparator(char sep) Set the current field separator.voidsetTextQualifier(char qual) Set the current text qualifier.
- 
Method Details- 
setFieldSeparatorpublic void setFieldSeparator(char sep) Set the current field separator.- Parameters:
- sep- The new field separator to be used; overwrites the old one
 
- 
setTextQualifierpublic void setTextQualifier(char qual) Set the current text qualifier.- Parameters:
- qual- The new text qualifier to be used; overwrites the old one
 
- 
getFieldSeparatorpublic char getFieldSeparator()Get the current field separator.- Returns:
- The char containing the current field separator
 
- 
getTextQualifierpublic char getTextQualifier()Get the current text qualifier.- Returns:
- The char containing the current text qualifier
 
 
-