title: Read CSV file and use StringTokenizer
body: <p>This is a simple homework assignment that has been driving me crazy for the last few days. If I were to use a couple of Arrays I could have done it a while ago but having to use the StringTokenizer is driving me nuts. </p>
  
  <p>The main problem I am having is reading the CSV file. I don't know how to do it and previous searches online have only brought forward super intense solutions that are too much for a beginner like me to handle. </p>
  
  <p>This is my code. As you can see, I don't know whether use <code>.nextLine()</code> or <code>.NextToken()</code>. Neither seems to work.</p>
  
  <p>For those wondering the assignment is basically reading the first 4 products separated by commas and reading the rest of the rows as the rating of those 4 products. Basically 6 rows with 4 columns. The first row is the products the rest are the ratings.</p>
  
  <pre><code>import java.util.StringTokenizer;
  import java.io.FileInputStream;
  import java.io.FileNotFoundException;
  import java.util.Scanner;
  
  public class ProductRating {
  
  public static void main(String[] args) {
      // TODO Auto-generated method stub
  
  
      Scanner fileIn=null;
      try{
          fileIn = new Scanner(
                   new FileInputStream("C:/Users/Cristian/Desktop"));
      }
      catch (FileNotFoundException e)
       {  // This block executed if the file is not found
          // and then the program exits
      System.out.println("File not found.");
      System.exit(0);
      }
  
      //If Opened File Successful this runs
      String products = "A";
      String rantings ="0";
      System.out.println("Gathering Ratings for Products");
  
      do{
  
          String delimiters = ", ";
  
          StringTokenizer gatherProducts[]=new StringTokenizer[inputLine, delimeters];
          gatherProducts=fileIn.nextLine();
  
      }while(fileIn.hasNextLine()==true);
  
  }   
  
  }
  </code></pre>