Java: Lire un fichier CSV ligne par ligne

Author:

 int,string,char,static, url, socket, url, socket, java
Download

/*
 * Ce code nécessite la bibliothèque OpenCV.
 * Cliquez sur le lien ci-dessus pour la télécharger.
 * 
 **/
 
import java.io.FileReader;
import java.io.IOException;
import java.io.StringWriter;
import java.util.List;
 
import au.com.bytecode.opencsv.CSVReader;
 
public class MyCSVReader
{
	public static void main (String[] args) throws Exception
		{
 
	     CSVReader reader = new CSVReader(new FileReader("CSV/fichier1.csv"));
    		String [] nextLine;
   			 while ((nextLine = reader.readNext()) != null)
   			 	 {
                   for(String valeur:nextLine)
                   		System.out.print (valeur);
                   	System.out.println ();
    		    }
 
        }
}