0

First part to my question is, if I have a CSV file with 4 numbers on one line separated by a comma, how do I ignore the first two values using openCSV?

Now, consider the following array:

int[][] parsedData = new int [10][10];

and the following line from a CSV file:

54, 68, 5, 1

assuming the former is possible (ignoring the first two values on a line in a CSV file), how do I then parse the value '5' into parsedData[0][0] and parse the value '1' into parsedData[0][1]?

I can't find anything in the openCSV documentation that would explain how to do this, nor can I wrap my head around even doing it if there weren't a CSV file to read beforehand.

rst-2cv
  • 1,130
  • 1
  • 15
  • 31

1 Answers1

1

You cannot do that within opencsv. You can ignore entire lines with the skiplines (which is normally used when the data has an header) but not part of a line. You will have to do that yourself programmatically.

Take a look at the java System.arraycopy method. I found an article on stack overflow with a good example.

Hope that helps.

:)

Community
  • 1
  • 1
Scott Conway
  • 975
  • 7
  • 13