-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCsvTester.java
More file actions
31 lines (27 loc) · 1.16 KB
/
Copy pathCsvTester.java
File metadata and controls
31 lines (27 loc) · 1.16 KB
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
import com.raja.util.CSVReader;
import java.util.ArrayList;
import java.util.Iterator;
public class CSVTester
{
public static void main(String[] args) throws Exception
{
// NOTE: any of the file operations below can fail, so deal with the exception suitably
CSVReader reader = new CSVReader();
ArrayList<ArrayList> outerList = reader.readCSV ("test1.csv");
for (ArrayList<String> innerList : outerList)
for (String str : innerList)
System.out.println (str);
System.out.println("---------------------------");
reader = new CSVReader('|');
outerList = reader.readCSV ("test2.tsv");
for (ArrayList<String> innerList : outerList)
for (String str : innerList)
System.out.println (str);
System.out.println("---------------------------");
reader = new CSVReader('|', '#');
outerList = reader.readCSV ("test3.tsv");
for (ArrayList<String> innerList : outerList)
for (String str : innerList)
System.out.println (str);
}
}