Package com.csvreader

Examples of com.csvreader.CsvWriter.writeRecord()


            }
            FileWriter fileWriter = new FileWriter(resource.getFile(), false);
            CsvWriter csvWriter = new CsvWriter(fileWriter, COMMA_SEPARATOR);
            // finally we have the values in order to be written to the CSV file.
            for (String[] data : writableData) {
                csvWriter.writeRecord(data);
               
            }
            csvWriter.close();

        } catch (IOException e) {
View Full Code Here


        row[TRUTH_COLUMN] = TRUTH_COLUMN_NAME;
        row[PREDICTION_COLUMN] = PREDICTION_COLUMN_NAME;
        row[CONFIDENCE_COLUMN] = CONFIDENCE_COLUMN_NAME;
        row[SEGMENT_COLUMN] = SEGMENT_COLUMN_NAME;

        out.writeRecord(row);

        for (Message message : messages) {
            row[ID_COLUMN] = Integer.toString(message.getId());
            row[PARTICIPANT_COLUMN] = message.getParticipant();
            row[TIME_COLUMN] = dateFormat.format(message.getTimestamp());
View Full Code Here

            row[TRUTH_COLUMN] = message.hasTrueLabel() ? message.getTrueLabel().toString() : null;
            row[PREDICTION_COLUMN] = message.hasPredictedLabel() ? message.getPredictedLabel().toString() : null;
            row[CONFIDENCE_COLUMN] = message.hasPredictionConfidence() ? message.getPredictionConfidence().toString() : null;
            row[SEGMENT_COLUMN] = message.hasSegmentId() ? Integer.toString(message.getSegmentId()) : null;

            out.writeRecord(row);
        }

        out.flush();
        return true;
    }
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.