Hi All, I am using Javascript file to export splunk data from dashboard to CSV file. Issue I am facing is : for few records where strings are long , data is breaking into next line. I want to wrap those long strings in " " to stop breaking data to next line. below is my code. could someone please help me to get expected result $('#exportBtn').on('click',function(e){
var searchObj= mvc.components.getInstance("rrc_main");
var myResults = searchObj.data('results',{
output_mode : 'json_rows',
count:0
});
myResults.on("data",function(){
if(myResults.hasData()){
var data= myResults.data().fields.tostring().replace("Edit,","");
var rows = myresults.data().rows;
$.each(rows, function(row){
data = data+ "\n";
for(var i=0; i< 53; i++){
if(rows[row][i]==="edit"){
continue;
}
if(rows[row][i]== null){
data= data +"\"\",";
}else{
data = data +"\""+ rows[row][i].tostring()+"\",";
}
}
}); Kindly help to wrap long strings in " " to read csv in proper format without breaking long strings in next line. Appreciate your help! thanks, ND
... View more