title: importing text files to spreadsheet with openpyxl
body: <p>I am reading Automate the Boring Stuff with Python. Chapter 12 asks you to write a program to read in the contents of several text files (using readLines() and insert these into a spreadsheet.</p>
  
  <p>After some trial and error I developed code that does this for two text files - however, I am curious if there are better / more efficient ways of doing this.</p>
  
  <pre><code>import openpyxl
  wb = openpyxl.Workbook()
  sheet = wb.active
  sheet.title = 'Data'
  test = open('data.txt')
  data = test.readlines()
  
  test2 = open('more_data.txt')
  data2 = test2.readlines()
  
  for i in range(1,5):
      cellref=sheet.cell(row=i, column=1)
      cellref.value=data[i-1]
  
  for i in range(1,5):
      cellref=sheet.cell(row=i, column=2)
      cellref.value=data2[i-1]
  
  
  wb.save("newer_data.xlsx")
  </code></pre>
  
  <p>I get the expected results but suspect my code could be improved</p>