title: How do I add the values I have gotten through parse to get the "value" of the "column"?
body: <p>My code goes through an input file and breaks it into "columns." </p>
  
  <pre><code>System.out.println(numberdouble);
  </code></pre>
  
  <p>It prints out the value for each row in that column. I tested this to check whether my program would properly iterate through the columns. I want to know how to output the sum of each column.</p>
  
  <p>Example:</p>
  
  <pre><code>[a, 1, 2, 3]
  [3, v, 3, x]
  [5, 1, d, c]
  </code></pre>
  
  <p>If I sum the values at column 0, I want it to add 3 and 5 together. If a value in the column is not a number, it should convert the value to 0.</p>
  
  <p>My code:</p>
  
  <pre><code>public static Double column_sum(String filename, int column)
  {
      if(column &lt; 0)
      {
          return null;
      }
      File temp = new File(filename);
      Scanner input_file;
      try
      {
          input_file = new Scanner(temp);
      }
      catch (Exception e)
      {
          return null;
      }
      ArrayList&lt;ArrayList&lt;String&gt;&gt; result = new ArrayList&lt;ArrayList&lt;String&gt;&gt;();
      while(input_file.hasNextLine())
      {
          String line = input_file.nextLine();
          List&lt;String&gt; myList = new ArrayList&lt;String&gt;(Arrays.asList(line.split(",")));
              Double numberdouble =0.0;
              String numberstring = myList.get(column);
              if(isDouble(numberstring))
              {
                numberdouble = Double.parseDouble(numberstring);
              }
              else
              {
                numberdouble=0.0;
              }
              System.out.println(numberdouble);
      }
      return 1.23; //placeholder
  }
  </code></pre>