Santosh Kumar

Santosh Kumar

  • NA
  • 126
  • 58.1k

How to validate the csv file.

Aug 28 2014 5:45 AM
 
Hi,
 
I am working on uploading the csv file and saving the data into database. I have done with saving part but what i need is to validate the csv with correct data farmat. 
-----------------------------------------------
Name     Address    Age    Gender
---------------------------------------------
a           Hyderabad   23      M
b           Banglore      25     F
c           Mumbai       26     M
---------------------------------------------
 
The Data In csv file need  to be In above format while upload. If they enter data in below format and trying to upload it then an error message need to be display saying "Upload Valid CSV File".
 
 
-----------------------------------------------
Name    Address      (Column Name Is missing)      Gender| Column0
--------------------------------------------
a          Hyderabad   23    M       |  ( Some Junk Data)
b          Banglore     25     F         |     
c          Mumbai      26      M       |
--------------------------------------------- 
 
--------------------------------------------
Xyz                               olp
 -------------------------------------------
 
 
I have googled a lot but did not found valid links which suits for my problem.
 
 
 

Answers (2)