Package org.encog.util.csv

Examples of org.encog.util.csv.CSVFormat


    // get filenames, headers & format
    String sourceID = prop.getPropertyString(
        ScriptProperties.HEADER_DATASOURCE_RAW_FILE);

    File sourceFile = this.analyst.getScript().resolveFilename(sourceID);
    CSVFormat inputFormat = this.analyst.getScript().determineInputFormat(sourceID)
    boolean headers = this.analyst.getScript().expectInputHeaders(sourceID);
     
    // read the file
    this.rowCount = 0;
    this.missingCount = 0;
View Full Code Here


   * @param af The analyst format.
   * @return The CSV format.
   */
  public static CSVFormat convertToCSVFormat(final AnalystFileFormat af) {
    if (af == AnalystFileFormat.DECPNT_COMMA) {
      return new CSVFormat('.', ',');
    } else if (af == AnalystFileFormat.DECPNT_SPACE) {
      return new CSVFormat('.', ' ');
    } else if (af == AnalystFileFormat.DECPNT_SEMI) {
      return new CSVFormat('.', ';');
    } else if (af == AnalystFileFormat.DECCOMMA_SPACE) {
      return new CSVFormat(',', ' ');
    } else if (af == AnalystFileFormat.DECCOMMA_SEMI) {
      return new CSVFormat(',', ';');
    } else {
      return null;
    }
  }
View Full Code Here

    final File sourceFile = getScript().resolveFilename(sourceID);
    final File targetFile = getScript().resolveFilename(targetID);

    // get formats
    final CSVFormat inputFormat = getScript()
        .determineInputFormat(sourceID);
    final CSVFormat outputFormat = getScript().determineOutputFormat();

    // mark generated
    getScript().markGenerated(targetID);

    // prepare to normalize
View Full Code Here

    EncogLogging.log(EncogLogging.LEVEL_DEBUG, "Beginning segregate");
    EncogLogging.log(EncogLogging.LEVEL_DEBUG, "source file:" + sourceID);

    // get formats
    final CSVFormat inputFormat = getScript()
        .determineInputFormat(sourceID);
    final CSVFormat outputFormat = getScript().determineOutputFormat();

    // prepare to segregate
    final boolean headers = getScript().expectInputHeaders(sourceID);
    final SegregateCSV seg = new SegregateCSV();
    seg.setScript(getScript());
View Full Code Here

    // get filenames
    final String sourceID = getProp().getPropertyString(
        ScriptProperties.GENERATE_CONFIG_SOURCE_FILE);
    final String targetID = getProp().getPropertyString(
        ScriptProperties.GENERATE_CONFIG_TARGET_FILE);
    final CSVFormat format = getAnalyst().getScript().determineInputFormat(
        sourceID);

    EncogLogging.log(EncogLogging.LEVEL_DEBUG, "Beginning generate");
    EncogLogging.log(EncogLogging.LEVEL_DEBUG, "source file:" + sourceID);
    EncogLogging.log(EncogLogging.LEVEL_DEBUG, "target file:" + targetID);
View Full Code Here

    String sourceID = prop.getPropertyString(
        ScriptProperties.HEADER_DATASOURCE_RAW_FILE);

    File sourceFile = this.analyst.getScript().resolveFilename(sourceID);

    CSVFormat inputFormat = this.analyst.getScript().determineInputFormat(sourceID);
   
    boolean headers = this.analyst.getScript().expectInputHeaders(sourceID);
 
    int rowSize = this.axisMapping.size();
   
View Full Code Here

    // mark generated
    getScript().markGenerated(targetID);

    // get formats
    final CSVFormat inputFormat = getScript()
        .determineInputFormat(sourceID);
    final CSVFormat outputFormat = getScript().determineOutputFormat();

    // prepare to normalize
    final AnalystNormalizeCSV norm = new AnalystNormalizeCSV();
    norm.setScript(getScript());
    getAnalyst().setCurrentQuantTask(norm);
View Full Code Here

   * @return The input format.
   */
  public final CSVFormat determineInputFormat(final String sourceID) {
    final String rawID = getProperties().getPropertyString(
        ScriptProperties.HEADER_DATASOURCE_RAW_FILE);
    CSVFormat result;

    if (sourceID.equals(rawID)) {
      result = getProperties().getPropertyCSVFormat(
          ScriptProperties.HEADER_DATASOURCE_SOURCE_FORMAT);
    } else {
View Full Code Here

      if (fileType == 0) {
        DialogCSV dialog2 = new DialogCSV(EncogWorkBench.getInstance()
            .getMainWindow());
        if (dialog2.process()) {
          boolean headers = dialog2.getHeaders().getValue();
          CSVFormat format;

          if (dialog2.getDecimalComma().getValue())
            format = CSVFormat.DECIMAL_COMMA;
          else
            format = CSVFormat.DECIMAL_POINT;
View Full Code Here

      if (fileType == 0) {
        DialogCSV dialog2 = new DialogCSV(EncogWorkBench.getInstance()
            .getMainWindow());
        if (dialog2.process()) {
          boolean headers = dialog2.getHeaders().getValue();
          CSVFormat format;

          if (dialog2.getDecimalComma().getValue())
            format = CSVFormat.DECIMAL_COMMA;
          else
            format = CSVFormat.DECIMAL_POINT;
View Full Code Here

TOP

Related Classes of org.encog.util.csv.CSVFormat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.