title: How to read the csv file and do validation for the csv Header columns in Javascript / JQuery
body: <p>I have a program where I'm reading the CSV file and validating the multiple CSV files header columns where columns Header count should be the same and columnsHeader name should be same (if it does not match, show some error message)</p>
  
  <p>I've done validation in python but I don't know how to do validate in javascript/jquery. I want to do it from Html file </p>
  
  <p><strong>Python program for validation:</strong></p>
  
  <pre><code>from flask import Flask, render_template
  import os
  import csv
  import pandas as pd
  import numpy as np
  app = Flask(__name__)
  
  APP_ROOT = os.path.dirname(os.path.abspath(__file__))
  @app.route("/")
  def index():
      print("Loading the root file")
      return render_template("upload.html")
  @app.route("/upload", methods=['POST'])
  def upload():
      target = os.path.join(APP_ROOT, 'input/')
          print("target-",target)
  
          if not os.path.isdir(target):
              os.mkdir(target)
  
  abs_path_files=[]
      for file in request.files.getlist("source_fileName"):
              print("file-",file)
              filename = file.filename
              print("filename-",filename)
              destination = "/".join([target, filename])
              print("destination-",destination)
              file.save(destination)
              print("file&gt;",file)
              tempFile = os.path.abspath(destination)
              abs_path_files.append(tempFile)
              print("abs_path_files - " ,abs_path_files)
              global files_list
              files_list=abs_path_files
              print("files_list-",files_list)
      return redirect('/compute',)
  
  @app.route("/compute")# Here we are performing the Header columns Validation 
  def compute():
      dataFrames=[]
      for f in files_list:
          dataFrame=pd.read_csv(f)
          dataFrames.append(dataFrame)
      col_in_files = set([",".join(list(f.column.values)) for f in dataFrames])
      if len(col_in_files)==1:
         # After validation it will go for the other computations
      .......................................................
  </code></pre>
  
  <p><strong>Html:</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt; upload &lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div class="container"&gt;
      &lt;h1&gt;Large Data Generation&lt;/h1&gt; 
  &lt;form id = "upload-form" action="{{ url_for('upload') }}" method="POST" enctype="multipart/form-data"&gt;
          &lt;div id="file-selector"&gt;
              &lt;p&gt; 
                  &lt;strong&gt;Source File: &lt;/strong&gt;
                  &lt;input id="source_fileName" type="file" name="source_fileName" accept="csv/*" multiple /&gt;
              &lt;/p&gt; 
          &lt;/div&gt;
      &lt;input type="submit" value="Generate Data" id="upload-button"  &gt;
  &lt;/form&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>