Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Reading CSV file in java

public class ParseCSV {
  public static void main(String[] args) {
    try {
      //csv file containing data
      String strFile = "C:/Users/rsaluja/CMS_Evaluation/Drupal_12_08_27.csv";
      CSVReader reader = new CSVReader(new FileReader(strFile));
      String [] nextLine;
      int lineNumber = 0;
      while ((nextLine = reader.readNext()) != null) {
        lineNumber++;
        System.out.println("Line # " + lineNumber);

        // nextLine[] is an array of values from the line
        System.out.println(nextLine[4] + "etc...");
      }
    }
  }
}
Comment

PREVIOUS NEXT
Code Example
Java :: java generate random id 
Java :: java random guid 
Java :: how to catch enter key in java text field 
Java :: how to enable cors request on springboot application 
Java :: how to convert string to boolean in java 
Java :: android string java 
Java :: intent filter 
Java :: android date time 
Java :: how to calculate exponential in java 
Java :: java 8 list stream delete by name 
Java :: java find last element in array 
Java :: java double format 
Java :: How to solve the N queens problem in Java? 
Java :: add stringarrays to string list java 
Java :: java indexof array 
Java :: java replace all not number 
Java :: bootstrap 4 modal get event related target 
Java :: jsp get query parameter 
Java :: java logger 
Java :: java summe array 
Java :: 12 hours to 24 hours java 
Java :: intent flag clear task 
Java :: java list distinct by object attribute 
Java :: print float number with only four places after the decimal point in java 
Java :: java remote debug 
Java :: fibonacci number in java 
Java :: setting scale to big decimal java 
Java :: java comments 
Java :: hello world java code 
Java :: tic tac toe in java 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =