read csv java android

Solutions on MaxInterview for read csv java android by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "read csv java android"
Hugo
06 Jan 2017
1import com.opencsv.CSVReader;
2import java.io.IOException;
3import java.io.FileReader;
4
5
6...
7
8try {
9    CSVReader reader = new CSVReader(new FileReader("yourfile.csv"));
10    String[] nextLine;
11    while ((nextLine = reader.readNext()) != null) {
12        // nextLine[] is an array of values from the line
13        System.out.println(nextLine[0] + nextLine[1] + "etc...");
14    }
15} catch (IOException e) {
16
17}