org.encog.app.analyst.csv.filter
Class FilterCSV

java.lang.Object
  extended by org.encog.app.analyst.csv.basic.BasicFile
      extended by org.encog.app.analyst.csv.filter.FilterCSV
All Implemented Interfaces:
QuantTask

public class FilterCSV
extends BasicFile

This class can be used to remove certain rows from a CSV. You can remove rows where a specific field has a specific value


Field Summary
 
Fields inherited from class org.encog.app.analyst.csv.basic.BasicFile
REPORT_INTERVAL
 
Constructor Summary
FilterCSV()
           
 
Method Summary
 void analyze(File inputFile, boolean headers, CSVFormat format)
          Analyze the file.
 void exclude(int fieldNumber, String fieldValue)
          Exclude rows where the specified field has the specified value.
 List<ExcludedField> getExcluded()
           
 int getFilteredRowCount()
           
 void process(File outputFile)
          Process the input file.
 
Methods inherited from class org.encog.app.analyst.csv.basic.BasicFile
appendSeparator, getColumnCount, getFormat, getInputFilename, getInputHeadings, getPrecision, getRecordCount, getReport, getReportInterval, getScript, isAnalyzed, isExpectInputHeaders, isProduceOutputHeaders, performBasicCounts, prepareOutputFile, readHeaders, reportDone, reportDone, requestStop, resetStatus, setAnalyzed, setColumnCount, setExpectInputHeaders, setInputFilename, setInputFormat, setInputHeadings, setPrecision, setProduceOutputHeaders, setRecordCount, setReport, setReportInterval, setScript, shouldStop, toString, updateStatus, updateStatus, validateAnalyzed, writeRow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FilterCSV

public FilterCSV()
Method Detail

analyze

public void analyze(File inputFile,
                    boolean headers,
                    CSVFormat format)
Analyze the file.

Parameters:
inputFile - The name of the input file.
headers - True, if headers are expected.
format - The format.

exclude

public void exclude(int fieldNumber,
                    String fieldValue)
Exclude rows where the specified field has the specified value.

Parameters:
fieldNumber - The field number.
fieldValue - The field value.

getExcluded

public List<ExcludedField> getExcluded()
Returns:
A list of the fields and their values, that should be excluded.

getFilteredRowCount

public int getFilteredRowCount()
Returns:
A count of the filtered rows. This is the resulting line count for the output CSV.

process

public void process(File outputFile)
Process the input file.

Parameters:
outputFile - The output file to write to.


Copyright © 2014. All Rights Reserved.