Python Forum
Reading Excel files and creating an output
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reading Excel files and creating an output
#2
Yes :)

Here's some pseudocode to help:
import shutil
from openpyxl import load_workbook

for file_prefix in ["a", "b"]:
    doc = load_workbook(filename= file_prefix + '.xlsx')
    sheet = doc['Sheet1']

    from_path = './'
    to_path = '/images/' + file_prefix + '/'

    for row in sheet.rows:
        image_id = row['M'] + ".jpg"
        shutil.copyfile(from_path + image_id, to_path + image_id)
Reply


Messages In This Thread
RE: Reading Excel files and creating an output - by nilamo - Aug-06-2018, 09:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unexpected output when trying to attach files in a mail application PythonU2Novel 0 430 May-17-2024, 02:59 AM
Last Post: PythonU2Novel
  Reading and storing a line of output from pexpect child eagerissac 1 4,557 Feb-20-2024, 05:51 AM
Last Post: ayoshittu
  Copy Paste excel files based on the first letters of the file name Viento 2 627 Feb-07-2024, 12:24 PM
Last Post: Viento
  trouble reading string/module from excel as a list popular_dog 0 516 Oct-04-2023, 01:07 PM
Last Post: popular_dog
  Reading data from excel file –> process it >>then write to another excel output file Jennifer_Jone 0 1,266 Mar-14-2023, 07:59 PM
Last Post: Jennifer_Jone
  merge two csv files into output.csv using Subprocess mg24 9 2,024 Dec-11-2022, 09:58 PM
Last Post: Larz60+
  Excel file reading problem max70990 1 993 Dec-11-2022, 07:00 PM
Last Post: deanhystad
  How to loop through all excel files and sheets in folder jadelola 1 4,936 Dec-01-2022, 06:12 PM
Last Post: deanhystad
  Creating csv files from Excel file azizrasul 40 6,767 Nov-03-2022, 08:33 PM
Last Post: azizrasul
Question Export Python output to Excel skyline1397 1 2,198 Jun-26-2022, 05:10 AM
Last Post: skyline1397

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020