I use the following code to read a .csv file in Java. How can I print the header of the file using this code? (I use the packages edu.duke and org.apache.commons.csv from here.)
import edu.duke.*;
import org.apache.commons.csv.*;
import java.io.*;
public class myCSVParser {
public static void readData() {
FileResource fr = new FileResource("smauto2.csv");
CSVParser ps = fr.getCSVParser();
// ??
}
public static void main(String[] args) {
readData();
}
}