Download this file

DataReader.java    40 lines (32 with data), 786 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
*
*/
package integrationTest.issue2153020;
import au.com.bytecode.opencsv.CSVReader;
import java.io.FileReader;
import java.io.IOException;
/**
* @author scott
*
*/
public class DataReader
{
private static final String ADDRESS_FILE="test/integrationTest/issue2153020/Sample.csv";
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException
{
CSVReader reader = new CSVReader(new FileReader(ADDRESS_FILE));
String [] nextLine;
while ((nextLine = reader.readNext()) != null) {
int numLines = nextLine.length;
System.out.println("Number of Data Items: " + numLines);
for (int i = 0; i < numLines; i++)
{
System.out.println(" nextLine[" + i + "]: " + nextLine[i]);
}
}
}
}