Package au.com.bytecode.opencsv

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


        if (header) {
            String cols[] = new String[vt.getColumnCount()];
            for (int i = 0; i < cols.length; i++) {
                cols[i] = vt.getColumnName(i);
            } // FOR
            writer.writeNext(cols);
        }
        vt.resetRowPosition();
        while (vt.advanceRow()) {
            String row[] = vt.getRowStringArray();
            assert(row != null);
View Full Code Here


        vt.resetRowPosition();
        while (vt.advanceRow()) {
            String row[] = vt.getRowStringArray();
            assert(row != null);
            assert(row.length == vt.getColumnCount());
            writer.writeNext(row);
        } // WHILE
    }
   
    /**
     * Pretty-printer for an array of VoltTables. This will reset
View Full Code Here

                if (write_header) {
                    String cols[] = new String[catalog_tbl.getColumns().size()];
                    for (int i = 0; i < cols.length; i++) {
                        cols[i] = catalog_tbl.getColumns().get(i).getName();
                    } // FOR
                    writer.writeNext(cols);
                }

                int total = 0;
                while (true) {
                    LOG.debug(String.format("%s: offset=%d, limit=%d", catalog_tbl.getName(), total, batch_size));
View Full Code Here

                    // Dump table contents
                    while (vt.advanceRow()) {
                        String row[] = vt.getRowStringArray();
                        assert(row != null);
                        assert(row.length == vt.getColumnCount());
                        writer.writeNext(row);
                    } // WHILE
                } // WHILE
               
                try {
                    writer.close();
View Full Code Here

        File output = new File("table.airport_distance.csv");
        CSVWriter writer = new CSVWriter(new FileWriter(output));
       
        // HEADER
        writer.writeNext(new String[]{ "D_AP_ID0", "D_AP_ID1", "D_DISTANCE" });

        // DATA
        long ctr = 0;
        String row[] = new String[3];
        for (Long id0 : locations.keySet()) {
View Full Code Here

                Pair<Double, Double> inner = locations.get(id1);
                Double distance = distance(outer, inner);
           
                row[1] = id1.toString();
                row[2] = distance.toString();
                writer.writeNext(row);
            } // FOR
            if (++ctr % 100 == 0) System.err.println(String.format("Processed %d / %d", ctr, locations.size()));
        } // FOR
    }
   
View Full Code Here

            List<DocumentHeader> dhs = dt.getDocumentHeaders();
            for (int i = 0; i < dhs.size(); i++) {
                DocumentHeader dh = dhs.get(i);

                tdvWriter
                        .writeNext(new String[] {
                                String.valueOf(i),
                                dh.getName() == null ? "-" : dh.getName(),
                                dh.getDescription() == null ? "-" : dh
                                        .getDescription(),
View Full Code Here

            for (TableNamespace ns : nt.getNamespaces()) {
                String nsp =
                        StringUtils.isBlank(ns.getPrefix()) ? "-" : ns
                                .getPrefix();

                tdvWriter.writeNext(new String[] {
                        String.valueOf(nt.getNamespaceIndex().get(ns)),
                        String.valueOf(nsp),
                        String.valueOf(ns.getResourceLocation()) });

                allWriter.writeNext(new String[] {
View Full Code Here

            for (final Entry<Integer, List<Integer>> e : dnsi.entrySet()) {
                Integer di = e.getKey();
                List<Integer> dnsl = e.getValue();
                if (noItems(dnsl)) continue;
                for (Integer nsi : dnsl) {
                    tdvWriter.writeNext(new String[] {
                            String.valueOf(di),
                            String.valueOf(nsi) });

                    allWriter.writeNext(new String[] {
                            String.valueOf(di),
View Full Code Here

                if (nsIndex != null) {
                    nsValue = String.valueOf(nsIndex);
                }

                if (parameterTable.getGlobalIndex().isEmpty()) {
                    tdvWriter.writeNext(new String[] {
                            String.valueOf(parameterTable
                                    .getTableParameterIndex()
                                    .get(parameter)),
                            nsValue,
                            parameter.getValue() });
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.