-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
26 lines (23 loc) · 760 Bytes
/
Main.java
File metadata and controls
26 lines (23 loc) · 760 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
// Main.java
package GettingUniqueValue;
import java.io.IOException;
import java.util.List;
import java.util.Set;
public class Main {
public static void main(String[] args) {
String csvFilePath = "src/effects-of-covid-19-on-trade.csv";
CSVUniqueValuesStreamReader reader = new CSVUniqueValuesStreamReader(csvFilePath);
try {
List<Set<String>> uniqueValuesList = reader.readUniqueValues();
for (int i = 0; i < uniqueValuesList.size(); i++) {
System.out.println("Unique values for column " + (i + 1) + ":");
for (String value : uniqueValuesList.get(i)) {
System.out.println(value);
}
System.out.println("--------------------");
}
} catch (IOException e) {
System.out.println("Error reading the CSV file: " + e.getMessage());
}
}
}