Coders Packet

Read a CSV file and Split the Data using JAVA

By Priyonath Mondal

  • StringTokenizerExample.class
  • Lib.PNG
  • Capture.PNG
  • It will read a CSV file from a particular path and split the data stored in the CSV file

    About the Project

    This code reads a CSV file line by line and uses StringTokenizer to split the lines with a "|" Delimiter

    The libraries used are:





    import java.nio.file.Files;

    import java.nio.file.Path;

    import java.nio.file.Paths;

    import java.util.ArrayList;

    import java.util.List;

    import java.util.StringTokenizer;


    The following line describes the path of the csv file and the delimiter by which the string needs to be splitted.

    List trends = obj.readFile(Paths.get("C:\\test\\sample.csv"), "|");


    Download Complete Code


    No comments yet