How to read data from CSV using Java PLM Developer

CSV (Comma Separated Values) is a file format having the values separated with a comma. Let us see how to read a CSV using a Java Program.  Reading the file and processing from BufferReader is one of the ways to do it.

Read Data From CSV in Java


public class ReadDataFromCSVFile {

             public static final String PATH = "C:\Input\Data.csv";

             public static void main(String[] args) throws FileNotFoundException {
              try {
                 BufferedReader reader = new BufferedReader(new FileReader(PATH));
                 String line = null;

                 while ((line = reader.readLine()) != null) {

                   String sData[] = line.split(",");

                     for (int i = 0; i < sData.length; i++) {
                          System.out.println("data:::::" + sData[i]);
                    // close reader
                   } catch (Exception e) {

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top