title: Display sum of specific column in Javascript
body: <p>I wish to display sum of amount for particular region.
  Below is my code to display the data, however I am sure how to add up the amount.
  I am able to read csv file an display in html table.
  I am new to Javascript. Any help to proceed would be much appreciated</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
  &lt;script type="text/javascript"&gt;
   function loadFile(o)
     {
       var fr = new FileReader();
       fr.onload = function(e)
        {
          showDataFile(e, o);
        };
      fr.readAsText(o.files[0]);
     }
  
   function showDataFile(e, o)
    { 
      var getCSVData = e.target.result;
      var rows = getCSVData.split("\n");
      var html = '&lt;table border="1"&gt;';
      rows.forEach((data, index) =&gt; 
      {
         html += "&lt;tr&gt;";
         var value = data.split(",");
         var region = value[1];
         var amount =value[3];
          if(region=="SA")
            {
               html += "&lt;td&gt;" + region + "&lt;/td&gt;";
               html += "&lt;td&gt;" + amount + "&lt;/td&gt;"
            }
         html += "&lt;/tr&gt;";
      });
           html += '&lt;/table&gt;';  
           document.getElementById("data").innerHTML = html;
           document.getElementById("data").style.color="blue";
     }
     &lt;/script&gt;
     &lt;title&gt; Read CSV file using JavaScript  &lt;/title&gt;
     &lt;/head&gt;
     &lt;body&gt;
      Select file to read &lt;input type="file" onchange="loadFile(this)"&gt;
      &lt;pre id="data"&gt;&lt;/pre&gt;
     &lt;/body&gt;
    &lt;/html&gt;
  </code></pre>