1) Using the regular expression, write a Python program to search and extract the clinic provider names,...
Fantastic news! We've Found the answer you've been seeking!
Question:
1) Using the regular expression, write a Python program to search and extract the clinic provider names, their address and phone numbers from the sample text "clinicinfo.txt" provided.
- Extract all the info into a dictionary taking 'provider name' as key, and a list of 'address' and 'phone' as value. Print out the dictionary, so we have a small 'database'.
- Count the item numbers inside this dictionary. Ask the user to input the provider's name, if the provider is in the database, print out the corresponding address and phone numbers. Otherwise, ask the user to input correct names and try again.
- Hint:
- There is No missing data for each item (i.e. name, address, phone)
- Use capturing group to extract info for each item (name, address, phone)
- Regex for provider’s name: how to match any/all chars after string “Clinic Name: ”
- Regex for provider’s address: how to match any chars after string “mi -” (Note: some addresses have space after dash -, some don’t)
- Regex for provider’s phone: how to match “xxx-xxx-xxxx” (x is digit)
- How to put address and phone in a list as the value of a dictionary?
Here are the information that's on file clinicinfo.txt
Clinic Name: Statesboro Family Practice 4.4 mi - 658 Northside Dr E Suite A 912-764-9684 Clinic Name: East Georgia Healthcare Center 3.7 mi - 1570 Brampton Ave 912-764-9196 Clinic Name: South Georgia Immediate Care Center 3.9 mi - 1096 Bermuda Run 912-871-5150 Clinic Name: AppleCare Statesboro Gentilly Square Shopping Center 4.3 mi -586 Brannen St 912-871-6611 Clinic Name: Statesboro Clinic 4.4 mi - 658 Northside Dr E 912-871-8719 Clinic Name: Martin Chiropractic Clinic 4.4 mi - 502 Gentilly Rd 912-764-6456 Clinic Name: East Georgia Womens Center 3.9 mi -1012 Bermuda Run 912-871-4800 Clinic Name: Statesboro Pediatric Clinic 4.5 mi - 404 Savannah Ave 912-764-9196 Clinic Name: Hanger Clinic: Prosthetics & Orthotics 3.6 mi - 1215A, Merchant Way 912-764-2148 Clinic Name: Cope Eye Clinic 5.1 mi - 81 E Jones Ave 912-764-8080 Clinic Name: Charlie Norwood VA Medical Center - Telehealth Clinic 4.4 mi - 658 Northside Dr E 912-871-8719 Clinic Name: Statesboro Women's Health Specialists 3.5 mi - 1523 Fair Rd 912-871-2000 Clinic Name: Southern Wellness & Rehab Physical therapy clinic 4.7 mi - 2 Ed Moore Ct 912-764-9951 Clinic Name: Bulloch County Health Department 4.0 (6) - Medical clinic 6.4 mi - 1 W Altman St 855-473-4374 Clinic Name: East Georgia Primary Care 3.0 (4) - Doctor 6.8 mi - 4451 Country Club Rd #3a 912-764-2273 Clinic Name: The Comprehensive Wound Healing Center No reviews - Medical clinic 3.6 mi - 1497 Fair Rd Suite 103 912-486-1163 Clinic Name: Choices of the Heart No reviews - Pregnancy care center 4.8 mi - 425 E Grady St 912-764-4303 Closed Opens 10AM Mon Clinic Name: Vidalia Women's Center No reviews - Women's Health Clinic 3.4 mi - 1601 Fair Rd Suite 200 912-243-9220 Clinic Name: Candler Internal Medicine 3.8 (10) - Medical clinic 3.2 mi - 106 Briarwood Rd 912-871-5000 Clinic Name: East Georgia Pain Management 3.6 mi - 1497 Fair Rd #206 912-486-1121
Related Book For
Accounting Information Systems
ISBN: 978-1133935940
10th edition
Authors: Ulric J. Gelinas, Richard B. Dull
Posted Date: