0

I have a file (datafile1) with more than 1.000 accounts followed by info in columns like this:

Accountname1 info1 info2 info3

Accountname2 info1 info2 info3 ...

and I have a template in excel with some text and logos. I want to import the data from datafile1 to the template and create a individual PDF for all accounts. So let's say 1.000 pdfs. Is there any way to get this done? Maybe an out of the box program, or python code? Thanks for your answers in advance.

Giorgi Beria
  • 86
  • 1
  • 11
hamdi
  • 1
  • 1

1 Answers1

0

What you need is csv library. You can read excel files and csv files with it, specifying a dialect argument.

import csv

with open(file_path)as excel_file:
    reader = csv.reader(excel_file, dialect='excel')
    for row in reader:
        #Your format goes here

You just have to specify what to do with each column in your file. In your case row[0] is account names and row[N] is infoN.

To write pdf's you can check this question.

Raulillo
  • 166
  • 1
  • 19