I am using the csvparser library from univocity and am having trouble converting a List object in to an array that would be easily read from.
The method that keeps throwing an ArrayStoreException is:
List<String[]> resolvedData;
String[] array = new String[7000];
public void parseURLs() throws FileNotFoundException {
CsvParserSettings settings = new CsvParserSettings();
settings.getFormat().setLineSeparator("\n");
CsvParser parser = new CsvParser(settings);
try {
resolvedData = parser.parseAll(new FileReader("C:\\Users\\kevin.anderson\\Desktop\\book1.csv"));
resolvedData.toArray(array);
} catch (Exception ex) {
System.out.println(ex.toString());
}
}
Is there a way to get the items out of a List into an array or is there an easy way to iterate thru the items in the List string array?
Thank you
String[]values into aString[]?String[], is captured in the list. The next question would be, what do you intend to do with the result?