title: SAS Dataframe to CSV
body: <p>I am relatively new to Pandas and exploring stuffs. I have a requirement that explains as below. I am using AWS Console (SageMaker)</p>
  <p>A group of SAS7BDAT files in a folder and each of these files are with different structure. These files are to be converted to CSV but has the following challenges.</p>
  <ol>
  <li>All SAS7BDAT files has poor data quality. Say, column values has special characters within the data like '\r\nSkinProduct,Cream'(in this data the comma is allowed but not newline or carriage return)</li>
  <li>When tried with sas7bdat_converter package with batch_to_csv    function, the    csv files creates with double quotes, numerical values are with float (say 200 value became 200.0)</li>
  </ol>
  <p>I tried the below code but cant figure out what am I missing</p>
  <pre><code>from sas7bdat import SAS7BDAT 
  file = &quot;&lt;folder/name/aaaa.sas7bdat&quot;
  with SAS7BDAT(file, skip_header=False) as reader:
      df = reader.to_data_frame()
  df
  
  import re
  df1=df.apply(lambda k:re.sub(&quot;[\n\r\t]&quot;, &quot;&quot;,df), axis=0, raw=False, result_type=None, args=())
  df1
  </code></pre>
  <p>Can someone assist me please? (I haven't tried to convert to csv yet but would like to view the dataframe post quality corrections)</p>