title: Reading specific column from CSV and converting to double for further calculations in Java
body: <p>I have a CSV file (fixed 43 columns and rows vary each time) which contains String and double values in it. I need to fetch values from 12th (NetPrice) and 13th (Tax) columns which are actually double values. I need to add (NetPrice + Tax) at each row, until end of CSV file and get the total amount. I am able to fetch the values as String format but while trying to convert to double, I am facing NumberFormatExeption. I understood that there is some mistake in conversion, but I am unable to identify it. Request to help for the same. Below is my code.</p>
  
  <p>I have found one solution for a similar problem in SO but it didn't help me, so posting my question.</p>
  
  <p><strong>Sample CSV file</strong></p>
  
  <p><a href="https://i.stack.imgur.com/suYCM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/suYCM.png" alt="enter image description here"></a></p>
  
  <p>At the end, I need to add again all the above added amount to get the final total price as highlighted in above image.</p>
  
  <p>public void getTotalPrice() throws IOException 
      {</p>
  
  <pre><code>    String csvFile = "file path";
      String line ;
      String cvsSplitBy = ",";
      String NetPrice;
      String Tax;
      double FinalTotal = 0.00;
  
      try (BufferedReader br = new BufferedReader(new FileReader(csvFile))) 
      {
          br.readLine();
          while ((line = br.readLine()) != null) 
          {
              String[] Amount = line.split(cvsSplitBy);
              NetPrice = Amount[11]; //hold 12th column value
              Tax = Amount[12]; //hold 13th column value
              double NP = Double.parseDouble(NetPrice); //convert String to double
              double T = Double.parseDouble(Tax); //convert string to double
              FinalTotal = FinalTotal + (NP+T); //calculation for getting final price
          }
  
      }catch(NumberFormatException n)
      {
          n.printStackTrace();
      }
  }
  </code></pre>
  
  <p>Below is the Error I am facing: </p>
  
  <pre><code>java.lang.NumberFormatException: For input string: ""78.63""
  </code></pre>
  
  <p>From the error message I understood that the string value that is trying to get parsed to double is reading with extra double quotes """"</p>