title: Ignoring null values reading a CSV file in Java
body: <p>I am being able to read my dataset( csv file ) but when I run my main class, It display all the rows including the rows with null values. Is there any way to ignore every row in the dataset with a missing value (ie. a null value)? 
  I was thinking of checking that in a method testNullValue() but I don't really know what to check. </p>
  
  <p>My Class</p>
  
  <pre><code>public static BufferedReader exTractTraningData(File datafile, String ListOfCharacteristics) throws IOException {
  
      try {
          //create BufferedReader to read csv file
          BufferedReader reader = new BufferedReader(new FileReader(datafile));
  
          String strLine = "";
          StringTokenizer st = null;
  
          int lineNumber = 0, tokenNumber = 0;;
  
  
          while ((strLine = reader.readLine()) != null) {
              lineNumber++;
              //break comma separated line using ","
              st = new StringTokenizer(strLine, ",");
  
              while (st.hasMoreTokens()) {
                  //display csv values
                  tokenNumber++;
                  System.out.println("Line # " + lineNumber
                          + ", Token : " + st.nextToken(",") );
              }
              //reset token number
              tokenNumber = 0;;
          }
      } catch (Exception e) {
  
          System.out.println("Exception while reading csv file: " + e);
      }
      return null;
  }
  
  public boolean testNullValue(String ListOfCharacteristics, String ListOfValues){
      return false;
  
  
  }
  </code></pre>
  
  <p>And Lastly, I don't why the results in my console is not displaying each rows like this "name", "2 ", "TV ", "As ", " 40", "10" for example while I specified it in here  st = new StringTokenizer(strLine, ",");</p>
  
  <p><a href="https://i.stack.imgur.com/zCZtt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zCZtt.png" alt="enter image description here"></a></p>