Package org.encog.app.analyst.csv.sort

Examples of org.encog.app.analyst.csv.sort.SortCSV


    }

    public void testSortHeaders() throws IOException
    {
        generateTestFileHeadings(true);
        SortCSV norm = new SortCSV();
        norm.getSortOrder().add(new SortedField(1,SortType.SortString,true));
        norm.process(INPUT_NAME,OUTPUT_NAME,true,CSVFormat.ENGLISH);

        BufferedReader tr = new BufferedReader(new FileReader(OUTPUT_NAME));

        Assert.assertEquals("\"a\",\"b\"", tr.readLine());
        Assert.assertEquals("\"one\",1", tr.readLine());
View Full Code Here


    }
   
    public void testSortNoHeaders() throws IOException
    {
        generateTestFileHeadings(false);
        SortCSV norm = new SortCSV();
        norm.getSortOrder().add(new SortedField(1,SortType.SortInteger,true));
        norm.setProduceOutputHeaders(false);
        norm.process(INPUT_NAME,OUTPUT_NAME,false,CSVFormat.ENGLISH);

        BufferedReader tr = new BufferedReader(new FileReader(OUTPUT_NAME));

        Assert.assertEquals("\"one\",1", tr.readLine());
        Assert.assertEquals("\"two\",2", tr.readLine());
View Full Code Here

    }

    public void testSortHeaders() throws IOException
    {
        generateTestFileHeadings(true);
        SortCSV norm = new SortCSV();
        norm.getSortOrder().add(new SortedField(1,SortType.SortString,true));
        norm.process(INPUT_NAME,OUTPUT_NAME,true,CSVFormat.ENGLISH);

        BufferedReader tr = new BufferedReader(new FileReader(OUTPUT_NAME));

        Assert.assertEquals("\"a\",\"b\"", tr.readLine());
        Assert.assertEquals("\"one\",1", tr.readLine());
View Full Code Here

    }
   
    public void testSortNoHeaders() throws IOException
    {
        generateTestFileHeadings(false);
        SortCSV norm = new SortCSV();
        norm.getSortOrder().add(new SortedField(1,SortType.SortInteger,true));
        norm.setProduceOutputHeaders(false);
        norm.process(INPUT_NAME,OUTPUT_NAME,false,CSVFormat.ENGLISH);

        BufferedReader tr = new BufferedReader(new FileReader(OUTPUT_NAME));

        Assert.assertEquals("\"one\",1", tr.readLine());
        Assert.assertEquals("\"two\",2", tr.readLine());
View Full Code Here

TOP

Related Classes of org.encog.app.analyst.csv.sort.SortCSV

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.