Examples of CSVPrinter


Examples of com.Ostermiller.util.CSVPrinter

    try {
      out = new FileOutputStream(outputFile);
      if (isExcel) {
        printer = new ExcelCSVPrinter(out);
      } else {
        printer = new CSVPrinter(out);
      }
      printer.changeDelimiter(delimiter);
      DataConnection dc = DataConnection.getInstance(view);
      if (dc == null || !dc.bIsConnectionMade) {
        return;
View Full Code Here

Examples of com.Ostermiller.util.CSVPrinter

        csvFile.createNewFile();

        // Create the printer
        CSVPrint csvPrint = null;
        if("UNIX".equals(style)) {
          csvPrint = new CSVPrinter(new OutputStreamWriter(new FileOutputStream(csvFile), "UTF-8"), '#', quoteCharacter, seperator, false, true);
        } else if("EXCEL".equals(style)) {
          csvPrint = new ExcelCSVPrinter(new OutputStreamWriter(new FileOutputStream(csvFile), "UTF-8"), quoteCharacter, seperator, false, true);
        }
        nameCsvPrintMap.put(entry.getParameterMap().get(NAME), csvPrint);
View Full Code Here

Examples of com.Ostermiller.util.CSVPrinter

   *             if there are i/o problems.
   */
  private static void exportAdductsToFile(final File file,
      final AdductType[] adducts) throws IOException {

    final CSVPrinter writer = new CSVPrinter(new FileWriter(file));
    for (final AdductType adduct : adducts) {

      writer.writeln(new String[]{adduct.getName(),
          String.valueOf(adduct.getMassDifference())});
    }
  }
View Full Code Here

Examples of org.apache.commons.csv.CSVPrinter

      // unicode escapes (it's harmless since 'u' would not otherwise
      // be escaped.
      strat.setUnicodeEscapeInterpretation(true);
    }

    printer = new CSVPrinter(writer, strategy);
   

    CSVStrategy mvStrategy = new CSVStrategy(strategy.getDelimiter(), CSVStrategy.ENCAPSULATOR_DISABLED, CSVStrategy.COMMENTS_DISABLED, '\\', false, false, false, false);
    strat = mvStrategy;
View Full Code Here

Examples of org.apache.commons.csv.CSVPrinter

      if (csvField.sf.multiValued() || csvField.values.size() > 1) {
        mvWriter.reset();
        csvField.mvPrinter.reset();
        // switch the printer to use the multi-valued one
        CSVPrinter tmp = printer;
        printer = csvField.mvPrinter;
        for (Fieldable fval : csvField.values) {
          csvField.sf.getType().write(this, csvField.name, fval);
        }
        printer = tmp;  // restore the original printer
View Full Code Here

Examples of org.apache.commons.csv.CSVPrinter

        }

        mvWriter.reset();
        csvField.mvPrinter.reset();
        // switch the printer to use the multi-valued one
        CSVPrinter tmp = printer;
        printer = csvField.mvPrinter;
        for (Object fval : values) {
          writeVal(csvField.name, fval);
        }
        printer = tmp;  // restore the original printer
View Full Code Here

Examples of org.apache.commons.csv.CSVPrinter

      // unicode escapes (it's harmless since 'u' would not otherwise
      // be escaped.
      strat.setUnicodeEscapeInterpretation(true);
    }

    printer = new CSVPrinter(writer, strategy);
   

    CSVStrategy mvStrategy = new CSVStrategy(strategy.getDelimiter(), CSVStrategy.ENCAPSULATOR_DISABLED, CSVStrategy.COMMENTS_DISABLED, '\\', false, false, false, false);
    strat = mvStrategy;
View Full Code Here

Examples of org.apache.commons.csv.CSVPrinter

      if (csvField.sf.multiValued() || csvField.values.size() > 1) {
        mvWriter.reset();
        csvField.mvPrinter.reset();
        // switch the printer to use the multi-valued one
        CSVPrinter tmp = printer;
        printer = csvField.mvPrinter;
        for (Fieldable fval : csvField.values) {
          csvField.sf.getType().write(this, csvField.name, fval);
        }
        printer = tmp;  // restore the original printer
View Full Code Here

Examples of org.apache.commons.csv.CSVPrinter

        }

        mvWriter.reset();
        csvField.mvPrinter.reset();
        // switch the printer to use the multi-valued one
        CSVPrinter tmp = printer;
        printer = csvField.mvPrinter;
        for (Object fval : values) {
          writeVal(csvField.name, fval);
        }
        printer = tmp;  // restore the original printer
View Full Code Here

Examples of org.apache.commons.csv.CSVPrinter

      if (root.getChildren().size() > 0) {

        LOGGER.log(Level.INFO, "write structure to cache file");
        final PrintWriter out = new PrintWriter(cacheFilePath.toFile());
        final CSVPrinter csvOut = new CSVPrinter(out, CSVFormat.EXCEL);
        writeStructureToCSVPrinter(csvOut, root);
        out.close();
      }
    } catch (final IOException e) {
      throw new CloudsyncException("Can't write cache file on '" + cacheFilePath.toString() + "'", e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.