Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 from docx import Documentimport math products = [ Parka , Boots, Snowshoes, Climbing Rope, Oxygen Tank, Ice Pick, Crampons ] for i

1 from docx import Documentimport math products =["Parka", "Boots", "Snowshoes", "Climbing Rope", "Oxygen Tank", "Ice Pick", "Crampons"] for i in range(numFiles): invoiceNum ="100"+ str(i).zfill(4) for j in range(random.randint(1,10)): if product in productList: else: subtot = round(random.random()*10**(random.randint (3,4)),2) total = round(subtot + tax, 2) aDoc = Document() pProd = aDoc.add_paragraph("PRODUCTS
") pProd.add_run(f"{key}:{productList[key]}
") aDoc.save(f"INV{invoiceNum}.docX") the file makedocs.py holds a script that when run will create a set of randomized invoices in the form of word documents. your task is to create a python script that processes all docx files created into a single spreadsheet that has a row for each invoice and columns for: invoice id, total number of products purchased, subtotal, tax, and total. the file a2_ex.xslx contains an example spreadsheet. 1. read documents (3%)2. extract data (9%)3. write spreadsheets (3%). please i want answer of this question in an easy way without using pandas with full file paths for my reference if you want you can upload images too
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

0130913677, 978-0130913678

More Books

Students also viewed these Databases questions

Question

Expand each expression using the Binomial Theorem. (x - 2) 6

Answered: 1 week ago

Question

Explain all drawbacks of application procedure.

Answered: 1 week ago