PYTHON Write a Python program that uses an expanded version of [0-9][0-9.,]* to recognize all the numbers found in a .txt file. The numbers should not end in a comma (,) or period ( . ). The numbers should include numeric expressions that contain any number word in the list on the next slide. The number patterns should also allow for combinations of digits and words, e.g., 100.5 million. It should help you to use the following list of number words [‘one’, ’two’, ’three’, ’four’, ’five’, ’six’, ’seven’, ’eight’, ’nine’, ’ten’, ’eleven’, ’twelve’, ’thirteen’, ’fourteen’, ’fifteen’, ’sixteen’, ’seventeen’, ’eighteen’, ’nineteen’, ’twenty’, ’thirty’, ’forty’, ’fifty’, ’sixty’, ’seventy’, ’eighty’, ’ninety’, ’hundred’, ’thousand’, ’million’, ’billion’, ’trillion’] in your regular expression patterns. The final version of this python program should be able to be run from the command line in a terminal as follows: python3 get_numbers.py input_file output_file Where intput_file is the name of the input file and output_file is the name of the output file. For example, get_numbers all-OANC.txt all-numbers.txt would find all the instances of numbers in all-OANC.txt and produce a file (all-numbers.txt) containing all instances of numbers, 1 per line. Note that "python3" or "python" or any version of a call to python is OK.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
PYTHON Write a Python program that uses an expanded version of [0-9][0-9.,]* to recognize all the numbers found in a .txt file. The numbers should not end in a comma (,) or period ( . ). The numbers should include numeric expressions that contain any number word in the list on the next slide. The number patterns should also allow for combinations of digits and words, e.g., 100.5 million. It should help you to use the following list of number words [‘one’, ’two’, ’three’, ’four’, ’five’, ’six’, ’seven’, ’eight’, ’nine’, ’ten’, ’eleven’, ’twelve’, ’thirteen’, ’fourteen’, ’fifteen’, ’sixteen’, ’seventeen’, ’eighteen’, ’nineteen’, ’twenty’, ’thirty’, ’forty’, ’fifty’, ’sixty’, ’seventy’, ’eighty’, ’ninety’, ’hundred’, ’thousand’, ’million’, ’billion’, ’trillion’] in your regular expression patterns. The final version of this python program should be able to be run from the command line in a terminal as follows: python3 get_numbers.py input_file output_file Where intput_file is the name of the input file and output_file is the name of the output file. For example, get_numbers all-OANC.txt all-numbers.txt would find all the instances of numbers in all-OANC.txt and produce a file (all-numbers.txt) containing all instances of numbers, 1 per line. Note that "python3" or "python" or any version of a call to python is OK.
Expert Solution
steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY