0

I've tried to create my reader like this:

CSVReader reader = new CSVReader(new FileReader("ping10102012.csv"), '\t');

int i=0;
while ( (nextLine = reader.readNext()) != null){
    System.out.println(nextLine[i]); // Debug only
}

And I'm having some issues with stuff. I'm only getting the first(column) values from my csv, and they're outputting pretty weird.

output:

I  D
2  7  2  2  2
2  4  6  9  4
...more like this

The columns are:

UnitId

Attempts

ACPower

etc. etc. Thanks for any help!

4

1 に答える 1

2

常に最初の列のみを印刷しており、i=0に割り当てられた値に変化はありませんi

これを試して:

         while ( (nextLine = reader.readNext()) != null){
            for(String value: nextLine){
               System.out.println(value); // Debug only
            }
        }
于 2012-10-11T15:36:55.533 に答える