title: JMeter - Beanshell PostProcessor - Writing JSON Response Data to csv in single column
body: <p>I am writing Result along with Response data to a csv file using BeanShell Postprocessor. Everything is working fine except following issue:
  - My response data is in JSON format and while writing to csv it is being written into different columns due to presence of comma "," in json, but I have to write the whole RESPONSE DATA in single column</p>
  
  <p>This is how my code looks:</p>
  
  <pre><code>import java.io.File;
  import org.apache.jmeter.services.FileServer;
  
  Result = "FAIL";
  Response = prev.getResponseDataAsString();
  if (Response.contains("{\"status\":true"))
         Result = "PASS";
  
  f = new FileOutputStream("C:/Users/Administrator/APIFramework/bean.csv", true); 
  p = new PrintStream(f);
  p.println( vars.get("id") + "," + Result + "," + Response);
  p.close();
  f.close();
  </code></pre>