The first time you're reading the line without processing it in the while loop, then you're reading it again but this time you're processing it. readLine() method reads a line and displaces the reader-pointer to the next line in the file. Hence, every time you use this method, the pointer will be incremented by one pointing to the next line.

This:

 while ((newLine = br.readLine()) != null) {
        newLine = br.readLine();
        System.out.println(newLine);
        lines.add(newLine);
    }

Should be changed to this:

 while ((newLine = br.readLine()) != null) {
        System.out.println(newLine);
        lines.add(newLine);
    }

Hence reading a line and processing it, without reading another line and then processing.

Answer from GingerHead on Stack Overflow
🌐
Baeldung
baeldung.com › home › java › java io › reading a csv file into an array
Reading a CSV File into an Array | Baeldung
May 9, 2025 - One option would be to use a custom CSV parser that reads line by line and uses a StringBuilder to fetch each value. An advantage of using this approach is being able to use a CSV file with commas embedded within values, along with a comma delimiter: "Kom, Mary",Unbreakable "Isapuari, Kapil",Farishta · Let’s learn how to use this method through an example: List<List<String>> records = new ArrayList<List<String>>(); try (BufferedReader br = new BufferedReader(new FileReader(CSV_FILE))) { String line = ""; while ((line = br.readLine()) != null) { records.add(parseLine(line)); } }
🌐
Java67
java67.com › 2015 › 08 › how-to-load-data-from-csv-file-in-java.html
How to load data from CSV file in Java - Example | Java67
You can load data from a CSV file in a Java program by using BufferedReader class from the java.io package. You can read the file line by line and convert each line into an object representing that data. Actually, there are a couple of ways to read or parse CSV files in Java e.g.
🌐
Blogger
javarevisited.blogspot.com › 2015 › 06 › 2-ways-to-parse-csv-files-in-java-example.html
2 Ways to Parse CSV Files in Java - BufferedReader vs Apache Commons CSV Example
August 7, 2021 - You open a CSV file and start reading it line by line, since each line contains a coma separated String, you need to split them using comma (",") and you will get an array of String containing each column.
🌐
Medium
medium.com › @singh.piyush › why-bufferedreader-is-better-than-csvreader-for-reading-csv-files-in-java-cead691c3658
Why BufferedReader is Better Than CSVReader for Reading CSV Files in Java | by Piyush Kumar Singh | Medium
February 15, 2025 - Before we compare, let’s quickly understand what each class does: BufferedReader: A standard Java class java.io that reads text from an input stream, buffering characters for efficient reading.
🌐
LabEx
labex.io › tutorials › java-reading-a-csv-file-117982
How to Read a CSV File in Java | LabEx
Reading CSV using BufferedReader Data read from CSV file: Row 0: name, age, city Row 1: John, 25, New York Row 2: Alice, 30, Los Angeles Row 3: Bob, 28, Chicago Row 4: Eve, 22, Boston · We import necessary Java classes for file I/O operations and data structures.
🌐
Medium
medium.com › tuanhdotnet › methods-and-techniques-for-working-with-csv-files-in-java-4601db73e08f
Methods and Techniques for Working with CSV Files in Java | by Anh Trần Tuấn | tuanhdotnet | Medium
July 19, 2025 - import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; public class CSVReaderExample { public static void main(String[] args) { String filePath = "data.csv"; // Replace with your CSV file path String line; String delimiter = ","; // Assumes a comma as the delimiter try (BufferedReader br = new BufferedReader(new FileReader(filePath))) { while ((line = br.readLine()) != null) { String[] fields = line.split(delimiter); for (String field : fields) { System.out.print(field…
Find elsewhere
🌐
TutorialsPoint
tutorialspoint.com › how-to-read-the-data-from-a-csv-file-in-java
How to read data from .csv file in Java?
July 1, 2020 - import java.io.FileReader; import com.opencsv.CSVReader; public class ReadFromCSV { public static void main(String args[]) throws Exception { //Instantiating the CSVReader class CSVReader reader = new CSVReader(new FileReader("D://sample.csv")); //Reading the contents of the csv file StringBuffer buffer = new StringBuffer(); String line[]; while ((line = reader.readNext()) != null) { for(int i = 0; i<line.length; i++) { System.out.print(line[i]+" "); } System.out.println(" "); } } }
🌐
YouTube
youtube.com › azhar techno coder
How to Read Data from CSV file in Java | Reading a CSV with BufferedReader Example in Java - YouTube
How to Read Data from CSV file in Java | Reading a CSV with BufferedReader Example in JavaCode:package com.general.interviewQuestions;import java.io.*;public...
Published   March 11, 2023
Views   475
🌐
codippa
codippa.com › home › how to read csv file in java with example
Java parse csv file: How to read csv file in java in 3 ways
April 10, 2021 - Method 1 : Using split function Read the csv file line by line using readLine() method of java.io.BufferedReader class. Split each line with comma(,) as a separator to get the words of the line into an array.
🌐
Stack Abuse
stackabuse.com › reading-and-writing-csvs-in-java
Reading and Writing CSVs in Java
February 20, 2019 - Let's consider the steps to open a basic CSV file and parse the data it contains: ... Create a BufferedReader and read the file line by line until an "End of File" (EOF) character is reached
🌐
javaspring
javaspring.net › blog › bufferedreader-to-read-csv-file-java-example
Efficiently Reading CSV Files in Java with BufferedReader — javaspring.net
BufferedReader is a class in the java.io package. It reads text from a character-input stream, buffering characters to provide efficient reading of characters, arrays, and lines. It has a buffer of a specified size (by default, it's usually 8192 characters) which reduces the number of actual I/O operations, thus improving performance. CSV files are plain text files where each line represents a row of data, and the values within each row are separated by a delimiter, usually a comma.
🌐
Medium
medium.com › javarevisited › how-to-read-text-file-with-bufferedreader-in-java-2b400163f0b6
How To Read Text File With BufferedReader In Java | by Suraj Mishra | Javarevisited | Medium
December 15, 2022 - BufferedReader class is one of the most used when it comes to read Text files in Java.This class provides methods that can read characters from input stream. As name says it buffers read characters hence efficient in reading files. In this article we will read csv file from Kaggle about Netflix top 10 movie using BufferedReader class.
🌐
Medium
medium.com › @zakariafarih142 › mastering-csv-parsing-in-java-comprehensive-methods-and-best-practices-a3b8d0514edf
Mastering CSV Parsing in Java: Comprehensive Methods and Best Practices | by Zakariafarih | Medium
November 25, 2024 - While this approach reduces dependencies, it requires careful handling of edge cases. Overview: Read the CSV file line by line using BufferedReader and split each line based on the comma delimiter.
🌐
Reddit
reddit.com › r/learnjava › reading csv file.
r/learnjava on Reddit: Reading CSV file.
May 29, 2023 -
Ok im trying to read from a csv file and some how my directory can't find it can someone help. The Cvs file is in my project src file which I have named Files as well. 

Heres the code:


 import java.io.BufferedReader;

import java.io.FileReader; import java.io.IOException; import java.io.*; public class Operrations {

public static void main(String[] args) throws Exception {

    String File = "Files\\Crimes.csv";

    BufferedReader reader = null;

    String line = "";

    try {

        reader = new BufferedReader(new FileReader(File));

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

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

        for(String index: row){

            System.out.printf("%-10", index);


        }

        System.out.println();






    




    }


    catch (Exception e){

        e.printStackTrace();



    }


    finally {


        try{


        reader.close();

        } catch(IOException e){

            e.printStackTrace();



        }




    }





}

}

🌐
Stack Overflow
stackoverflow.com › questions › 60046021 › writing-to-and-reading-from-a-csv-file-java
bufferedreader - Writing to and Reading From a csv file (Java) - Stack Overflow
February 3, 2020 - public class StudentDataTestExercise { public static void main(String[] args) { File file = new File("./src/data.csv"); File file2 = new File("./src/dataNew.csv"); String line = null; String line2 = null; try (BufferedReader br = new BufferedReader(new FileReader(file)); BufferedWriter bw = new BufferedWriter(new FileWriter(file2)); BufferedReader br2 = new BufferedReader(new FileReader(file2))) { while ((line = br.readLine()) != null) bw.write(line + "\n"); String s = String.format("%d;%s;%s;%s;%s", 123442,"ece", "erkul", "[email protected]","mathe 1, mathe 2, BuK, Anwendungssysteme, Konstruktion 3"); bw.write(s); while ((line2 = br2.readLine()) != null) System.out.println(br2.readLine()); } catch (IOException e) { e.printStackTrace(); } } }
🌐
Blogger
javarevisited.blogspot.com › 2015 › 06 › 2-ways-to-parse-csv-files-in-java-example.html
Javarevisited: 2 Ways to Parse CSV Files in Java - BufferedReader vs Apache Commons CSV Example
Second method is interesting as it demonstrate how to use apache commons csv library to read csv file. As I said, commons csv supports several csv format directly and we will use CSVFormat.DEFAULT, which also supports header. Here you create an instance of CSVParser by passing it a FileInputStream, which points to your csv file and CSVFormat. This contains several CSVRecord from which you can retrieve individual fields. import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.List; i