title: python - reading text, excel, csv file into ms sql server
body: <p>I am fairly new to python and I noticed the syntax are quite different from vb.net. I am trying to import data from, in this case, csv into ms sql server.</p>
  
  <p>my csv file have 9 columns, some columns and rows are blank and some are not. </p>
  
  <pre><code>import csv
  import os
  
  os.chdir('C:\\Users\\Desktop\\PROGRAMs\\TEST')
  
  with open('test.csv', newline='') as csvfile:
      spamreader = csv.reader(csvfile)
      for row in spamreader:
          print(row)
  </code></pre>
  
  <p>my code above produced this output, below:
  Highlighted in yellow are what's blank in column G &amp; H for row 3. How do I break each of these columns and rows and load them into ms sql server given that the database is test, and table is testload and all the fields matched as A, B, C, D, E, F, G, H, I ? It's a localhost sql server and the server name is SQL_SERVER</p>
  
  <p><a href="https://i.stack.imgur.com/bXSZn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bXSZn.png" alt="enter image description here"></a></p>