Skip to content

Instantly share code, notes, and snippets.

@Snbig
Created June 28, 2019 11:26
Show Gist options
  • Save Snbig/50b33b355b9c53268871e8dc44b03b70 to your computer and use it in GitHub Desktop.
Save Snbig/50b33b355b9c53268871e8dc44b03b70 to your computer and use it in GitHub Desktop.
Export InstaTrack results to Excel
import xlwt
collections = list()
def toExcel(file):
with open(file, 'r') as file:
collections = file.readlines()
wb = xlwt.Workbook()
ws = wb.add_sheet('Instagram Collection')
ws.write(0, 0, "UserID")
ws.write(0, 1, "Username")
i = 1
for row in collections:
userid = row.split(':')[0]
username = row.split(':')[1]
ws.write(i, 0, int(userid))
ws.write(i, 1, username)
i = i + 1
wb.save('collection.xls')
# Run like toExcel("[result.txt file location]")
# Output : collection.xls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment