Package au.com.bytecode.opencsv

Examples of au.com.bytecode.opencsv.CSVWriter.writeNext()


                        ban.getAddress(),
                        ban.getReason(),
                        String.valueOf(ban.getStart()),
                        String.valueOf(ban.getEnd())
                };
                writer.writeNext(line);
            }
            writer.flush();
            writer.close();
        } catch (IOException e) {
            logger().warning("Failed to save " + storageFile.getAbsolutePath()
View Full Code Here


                toStore.addAll(locations.values());

                for (NamedLocation warp : toStore) {

                    UUID ID = warp.getCreatorID();
                    csv.writeNext(new String[] {
                            warp.getName(),
                            warp.getWorldName() != null ? warp.getWorldName()
                                    : warp.getLocation().getWorld().getName(),
                            String.valueOf(ID != null ? ID : warp.getCreatorName()),
                            String.valueOf(warp.getLocation().getX()),
View Full Code Here

    if(addHeader) {
      String[] header = new String[schema.getFields().size()];
      for(int i = 0; i < schema.getFields().size(); i++) {
        header[i] = schema.getFields().get(i).getName();
      }
      csvWriter.writeNext(header);
    }
    return new TupleTextRecordWriter(schema, csvWriter);
  }

  public static class TupleTextRecordWriter extends RecordWriter<ITuple, NullWritable> {
View Full Code Here

    CSVWriter writer = new CSVWriter(new FileWriter(tsvFile), '\t');

    for (AnnotatedSurfaceFormOccurrence instance : instances) {
      String annotationString = instance.getSpotClass() == SpotClass.valid ? "t" : "c";
      writer.writeNext(new String[] {instance.getSurfaceForm(), "" + instance.getOffset(), instance.getTextString(),
          instance.getAnnotationTitle(), instance.getAnnotationAbstract(), annotationString});
                                                         // getAnnotationAbstract() seems to be always null?
    }

    writer.close();
View Full Code Here

        String.valueOf(sumSalesman),
        String.valueOf(idExpensiveSale),
        getWorstSalesman()
      };
   
    writer.writeNext(data);
    writer.close();
  }
}
View Full Code Here

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        CSVWriter ecsvp = new CSVWriter(new OutputStreamWriter(baos), ';');
        //Generate the item row
        List<String> colLabels = getColLabels();
        colLabels.add(0, "");
        ecsvp.writeNext(colLabels.toArray(new String[colLabels.size()]));
        List<String> rowLabels = getRowLabels();

        String[][] matrix = getMatrix();
        for (int i = 0; i < rowLabels.size(); i++) {
            String rowLabel = rowLabels.get(i);
View Full Code Here

        List<String> rowLabels = getRowLabels();

        String[][] matrix = getMatrix();
        for (int i = 0; i < rowLabels.size(); i++) {
            String rowLabel = rowLabels.get(i);
            ecsvp.writeNext((String[]) ArrayUtils.addAll(new String[]{rowLabel}, matrix[i]));
        }
        ecsvp.flush();
        ecsvp.close();
        return baos;
    }
View Full Code Here

                tempCsvFiles.add(tempCsv);
                CSVWriter csvp = new CSVWriter(new FileWriter(tempCsv));
                //csvp.setAlwaysQuote(false);

                //Write the header !
                csvp.writeNext((String[]) ArrayUtils.add(header, "bundleName"));
                Map<Integer, String> bitBundleCache = new HashMap<Integer, String>();
                //Loop over each line (skip the headers though)!
                for (int j = 1; j < csvParsed.length; j++){
                    String[] csvLine = csvParsed[j];
                    //Write the default line !
View Full Code Here

                        //If we don't have one & we do not need to delete the deleted bitstreams ensure that a BITSTREAM_DELETED bundle name is given !
                        if(bundleName == null && !removeDeletedBitstreams){
                            bundleName = "BITSTREAM_DELETED";
                        }
                    }
                    csvp.writeNext((String[]) ArrayUtils.add(csvLine, bundleName));
                }

                //Loop over our parsed csv
                csvp.flush();
                csvp.close();
View Full Code Here

        sa[4] = "Digital Object Source";
        sa[5] = "Stage";
        sa[6] = "Property Identifier";
        sa[7] = "Property Value";
        // write the headers out:
        writer.writeNext(sa);
       
        // Loop through:
        int bi = 1;
        for( BatchExecutionRecordImpl batch : exp.getExperimentExecutable().getBatchExecutionRecords() ) {
            // log.info("Found batch... "+batch);
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.