Im having issues with reading a csv file using jquery ajax.I have two csv files with the same content.we are using the below code to get the data from the csv file.
$(document).ready(function()
{
$.ajax({
type : "GET",
url : "data/application_index1.csv",
dataType : "text",
async : false,
success :
function(data)
{
console.log(data)
all_application = CSVToArray(data);
}
});
});
The data count of the csv file is 8.when we are converting the data from the csv file to array,we are getting length of the array as 8 (for one csv file). and for the other csv file the length is 9. Upon debugging the code, below is the data obtained from the csv file (correct one)
"index,application_name
1,Friday Daily Jobs WK1
2,Monday Additional Jobs
3,"Monday Daily Jobs
"
4,Non Daily Jobs
5,NonBATCHNDC Daily Jobs
6,Others
7,Tue-Fri Daily"
when we convert the above to arrays, we get the length of the array as 8. which is correct. But when we use the other csv file the data we get is the below
"index,application_name
1,Friday Daily Jobs WK1
2,Monday Additional Jobs
3,Monday Daily Jobs
4,Non Daily Jobs
5,NonBATCHNDC Daily Jobs
6,Others
7,Tue-Fri Daily
"
Above is the data that we get when I debug the code.When we convert the above to array, the length of the array becomes 9.The quotes('"') displayed at the last line of the data is considered as one more array. Can someone please explain the reason for the same. Also it would be great how the data is read from the url specified in the ajax() function.
AnyHelp on this is much appreciated. Thanks