Package net.sf.jmatchparser.util.csv

Examples of net.sf.jmatchparser.util.csv.CSVWriter


    Document doc = parser.parse(new ByteArrayInputStream("\n".getBytes("ISO-8859-1")), "ISO-8859-1", "csv");
    StringWriter sw1 = new StringWriter();
    StringWriter sw2 = new StringWriter();

    CSVWriter w1 = new CSVWriter(sw1, ',');
    CSVWriter w2 = new CSVWriter(sw2, ';');
    Parser.convertDOMToCSV(doc, new AbstractCSVWriter[] { w1, w2 });
    Parser parser2 = buildParser("BLOCK row\r\n" +
        "SET �/cell� And another row\r\n" +
        "ENDBLOCK\r\n" +
        "ML\r\n");
    parser2.parseToCSV("\n", w2);
    w1.close();
    w2.close();
    Assert.assertEquals("\"Last Name\",\"First Name\"\r\n\"Adams\",\"Douglas\"\r\n", sw1.toString());
    Assert.assertEquals("\"\";\"This is for the second file\"\r\n\"And another row\"\r\n", sw2.toString());
  }
View Full Code Here

TOP

Related Classes of net.sf.jmatchparser.util.csv.CSVWriter

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.