public class CSVSaver extends AbstractFileSaver implements BatchConverter, IncrementalConverter, FileSourcedConverter
-F <separator> The field separator to be used. '\t' can be used as well. (default: ',')
-M <str> The string representing a missing value. (default: ?)
-N Don't write a header row.
-decimal <num> The maximum number of digits to print after the decimal place for numeric values (default: 6)
-i <the input file> The input file
-o <the output file> The output file
Saver,
Serialized FormBATCH, INCREMENTAL, NONE| Constructor and Description |
|---|
CSVSaver()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
fieldSeparatorTipText()
Returns the tip text for this property.
|
Capabilities |
getCapabilities()
Returns the Capabilities of this saver.
|
java.lang.String |
getFieldSeparator()
Returns the character used as column separator.
|
java.lang.String |
getFileDescription()
Returns a description of the file type.
|
int |
getMaxDecimalPlaces()
Get the maximum number of decimal places to print
|
java.lang.String |
getMissingValue()
Returns the current placeholder for missing values.
|
boolean |
getNoHeaderRow()
Get whether to not write the header row
|
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier.
|
java.lang.String |
getRevision()
Returns the revision string.
|
java.lang.String |
globalInfo()
Returns a string describing this Saver.
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] args)
Main method.
|
java.lang.String |
maxDecimalPlacesTipText()
Returns the tip text for this property.
|
java.lang.String |
missingValueTipText()
Returns the tip text for this property.
|
java.lang.String |
noHeaderRowTipText()
Returns the tip text for this property.
|
void |
resetOptions()
Resets the Saver.
|
void |
setFieldSeparator(java.lang.String value)
Sets the character used as column separator.
|
void |
setMaxDecimalPlaces(int maxDecimal)
Set the maximum number of decimal places to print
|
void |
setMissingValue(java.lang.String value)
Sets the placeholder for missing values.
|
void |
setNoHeaderRow(boolean b)
Set whether to not write the header row
|
void |
setOptions(java.lang.String[] options)
Valid options are:
|
void |
writeBatch()
Writes a Batch of instances.
|
void |
writeIncremental(Instance inst)
Saves an instances incrementally.
|
cancel, filePrefix, getFileExtension, getFileExtensions, getUseRelativePath, getWriter, resetWriter, retrieveDir, retrieveFile, runFileSaver, setDestination, setDestination, setDir, setDirAndPrefix, setEnvironment, setFile, setFilePrefix, setUseRelativePath, useRelativePathTipTextdoNotCheckCapabilitiesTipText, getDoNotCheckCapabilities, getInstances, getWriteMode, resetStructure, setDoNotCheckCapabilities, setInstances, setRetrieval, setStructureequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFileExtension, getFileExtensions, getUseRelativePath, retrieveFile, setFile, setUseRelativePathpublic java.lang.String globalInfo()
public java.util.Enumeration<Option> listOptions()
listOptions in interface OptionHandlerlistOptions in class AbstractFileSaverpublic void setOptions(java.lang.String[] options)
throws java.lang.Exception
-F <separator> The field separator to be used. '\t' can be used as well. (default: ',')
-M <str> The string representing a missing value. (default: ?)
-N Don't write a header row.
-decimal <num> The maximum number of digits to print after the decimal place for numeric values (default: 6)
-i <the input file> The input file
-o <the output file> The output file
setOptions in interface OptionHandlersetOptions in class AbstractFileSaveroptions - the list of options as an array of stringsjava.lang.Exception - if an option is not supportedpublic java.lang.String[] getOptions()
getOptions in interface OptionHandlergetOptions in class AbstractFileSaverpublic java.lang.String noHeaderRowTipText()
public void setNoHeaderRow(boolean b)
b - true if no header row is to be writtenpublic boolean getNoHeaderRow()
public void setMaxDecimalPlaces(int maxDecimal)
maxDecimal - the maximum number of decimal places to printpublic int getMaxDecimalPlaces()
public java.lang.String maxDecimalPlacesTipText()
public void setFieldSeparator(java.lang.String value)
value - the character to usepublic java.lang.String getFieldSeparator()
public java.lang.String fieldSeparatorTipText()
public void setMissingValue(java.lang.String value)
value - the placeholderpublic java.lang.String getMissingValue()
public java.lang.String missingValueTipText()
public java.lang.String getFileDescription()
getFileDescription in interface FileSourcedConvertergetFileDescription in class AbstractFileSaverpublic void resetOptions()
resetOptions in class AbstractFileSaverpublic Capabilities getCapabilities()
getCapabilities in interface CapabilitiesHandlergetCapabilities in class AbstractSaverCapabilitiespublic void writeIncremental(Instance inst) throws java.io.IOException
writeIncremental in interface SaverwriteIncremental in class AbstractSaverinst - the instance to savejava.io.IOException - throws IOEXception if an instance cannot be saved
incrementally.public void writeBatch()
throws java.io.IOException
writeBatch in interface SaverwriteBatch in class AbstractSaverjava.io.IOException - throws IOException if saving in batch mode is not
possiblepublic java.lang.String getRevision()
getRevision in interface RevisionHandlerpublic static void main(java.lang.String[] args)
args - should contain the options of a Saver.