Week 8 is about data that arrives as text or pictures instead of a table. Notes typed by a person, for a person. States typed many different ways. A schedule that exists only as a scan. Lab 8 turns typed text into columns in a spreadsheet. HW 8 turns Project 2's Schedule A, a scanned table, into a file you can check and use in the project. Every result this week gets checked against something you can name.
The Lab 8 route
One workbook, two tabs, one upload. Work in Google Sheets or Excel. No Python is required.
- Lab 8 instructionsRequired
The full lab: what each tab holds, the rule for Tab 2, and how it is scored. Download lab_08_workbook.xlsx from there or here. - Tab 1, orders: regular expressions
Each order has a notes field typed by a sales rep. Use REGEXEXTRACT to split it into Invoice_Number, Contact_Name, Follow_Up_Date and Clean_Notes. Google Sheets and Excel for Microsoft 365 both have the function. Leave the formulas in the workbook: full credit needs them, and typed or pasted values earn half. - Tab 2, states: AI in the spreadsheet, by chat
Each row is a state and a country exactly as a Project 2 owner typed it. Fill in the two-letter state_code for the state it reports to: two capital letters, with no spaces and nothing else in the cell, for example AZ. These codes go straight into Project 2: they join each owner to Schedule A. For the first pass, open Gemini in Google Sheets or the Copilot chat window in Excel, give it the rule and the two columns, and paste the answers back as plain values. If your account has neither, use any AI chat or a lookup. Then check every row against the rule yourself.
The HW 8 route
Project 2's Schedule A is a scanned table on pages 3 and 4 of the counsel memo. HW 8 turns it into one CSV, one row per state. It is graded on accuracy, cell by cell, and the same file goes into Project 2.
- What you needStart here
- Schedule A as a PDF (both pages)
- Page 3 image, Alabama to Montana
- Page 4 image, Nebraska to Wyoming
- The CSV template. The exact header and the first three rows, filled in. Add the other 47 states, with every footnote mark kept exactly as printed.
- The Schedule A File Check, to check the file before you upload it
- Pick a path. You can mix them.
- An AI that reads images
- Such as Claude or ChatGPT. One page at a time, then validate.
- Adobe Acrobat
- Scan & OCR on the scan as a PDF, then export to Excel and see how it goes.
- Python OCR
- Tesseract from Python, in Colab or your own install. Slower the first time, seconds after. The path to take if the job repeats.
- Hand key
- Fifty rows of short values. Key it, then check it.
- Schedule A File CheckFree, optional
Checks the header, the 50 rows and the allowed values, then names any cell that does not match the schedule. It never shows the right value. The image decides.
What you submit, and where
Lab 8, due Sunday, October 25, 11:59 PM MT
| What | Where | Points |
|---|---|---|
The finished workbook, both tabs, saved as <uID>_lab_08.xlsx: Tab 1 is 50 and needs the REGEXEXTRACT formulas for full credit, Tab 2 is 48 and needs only the checked codes | File upload in Lab 8 in Canvas | 98 |
| The closing questions | Lab 8 in Canvas | 2 |
HW 8, due Sunday, October 25, 11:59 PM MT
| What | Where | Points |
|---|---|---|
The Schedule A file, saved as <uID>_hw_08.csv, in proportion to the cells that match the schedule | File upload in HW 8 in Canvas, one attempt | 98 |
| Which path you used | HW 8 in Canvas | Not graded |
| The closing questions | HW 8 in Canvas | 2 |
Project 2 has its own Canvas assignment, due Sunday, November 1, 11:59 PM MT.
Upload the files themselves: the workbook as .xlsx and the schedule as .csv, not a PDF or a sharing link.
The tools
Every tool here is optional. None of them submits anything.
- OCR WorkbenchFor HW 8
Run OCR on Project 2's Schedule A in your browser, with no install, and see how sure the engine is about each word. It also copies the page for Excel Data from Picture and links the scan as a PDF for Acrobat. - Extraction Field GuideFor HW 8
Each way to get the table out of the scan: an AI that reads images, Acrobat, Python OCR, hand keying, Excel Data from Picture and the Workbench. When each fits, how each fails, and how to check the result. - Schedule A File CheckFor HW 8
The free check of your HW 8 file before you upload it. - Regex TrainerOptional practice
The pieces of a regular expression, in the order of the live demo: digits and repeats, anchors, optional groups, letter ranges and capture groups. Real Python runs in your browser. Not graded. - Chart Read CompareOptional practice
Rebuild a chart’s monthly table when only the total is published, the way an analyst reads an earnings deck. Three model reads and your own hand read, each tied to the printed total. Not graded.
Replay the live demo
The lecture builds regular expressions live in RegExr, one piece at a time. Each link below opens RegExr with that step's pattern and test text already loaded. Change the pattern and watch the matches move.
- Meet RegExr
A month pattern that finds four matches. One of them is a false positive. Find it. - Step 1: five digits, anywhere
A bare five-digit pattern finds a ZIP inside junk and inside a ZIP+4. - Step 2: anchor the whole field
Anchors make the pattern match the whole line or nothing. - Step 3: an optional group
The optional group brings back ZIP+4. The pattern still accepts a Mexican postal code, because a format cannot tell you the country. - Your turn: a Canadian postal code
A starter pattern, a letter then a digit. Grow it until each line is all or nothing. - Step 4: capture groups
Three groups pull a reference, a date and an amount out of bank memo lines. The wire line does not match. REGEXEXTRACT can return what each group captures, which is how Tab 1 works.
RegExr runs JavaScript regular expressions. Google Sheets and Excel run their own engines. The demo patterns match the same way in all three. Flags are written differently: RegExr's /i is (?i) at the start of the pattern in a spreadsheet, and /m is (?m).
From earlier weeks
- Week 3 Left Join Visualizer. The coverage habit: count what went in and what came out. Tab 2 keeps every state and country pair once, and the HW 8 file has each of the 50 states once.
- Week 7 Functions Trainer.
defandreturn, if you take the Python OCR path in HW 8. - Week 5 Chart-Mechanics Primer. The table behind each chart. The optional Chart Read Compare runs that direction backwards.
Introduction to NLP Not graded
This week also introduces natural language processing: turning text into features, then sentiment, topics and embeddings. It is an introduction to where text analysis goes next. No graded item depends on it.
Watch Mac Gaulin's videos 7.4, 7.5 and 7.6 on the Week 8 Videos page in Canvas, and read the NLP section near the end of the lecture slides. The same Videos page lists the extraction videos that support Lab 8 and HW 8.
What the tutor sees, and a prompt to copy into another AI tool
The tutor sees this page's section list and which section is on screen. Nothing you type on this page is sent unless you type it into the chat yourself. The preview shows the complete prompt, including earlier turns of the conversation.
Nothing on these pages submits to Canvas. Anything a page keeps stays in this browser.