Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Program #6: File conversion -- remove control blocking data from backups You are working on a project where you are given data that has been

Program #6: File conversion -- remove control blocking data from backups

You are working on a project where you are given data that has been through a "backup" program which, at times, added extraneous data. You discover that the data added has a pattern. The pattern is the corrupt data ALWAYS starts with a CONTROL-C and always ends in a CONTROL-B, and that at most 4 carriage returns are introduced with such an event. You also discover that after the CONTROL-C, there may be more Control-C characters as part of the extraneous data.

You are to write a program in PYTHON which removes these values from the example file

control-char.txt:

This is line 1 This is line 1 This is line 1 This is line 2 This is line 2 This is line 2 This is li ne 3 This is line 3 This is line 3 This is line 4 This is line 4 This is line 4 This is line 5 This is line 5 This is line 5 This is line 6 This is line 6 This is line 6 This is line 7 This is line 7 This is line 7 This is line 8 This is line 8 This is line 8 This is line 9 This is line 9 This is line 9 This is line 10 This is line 10 This is line 10 This is line 11 This is line 11 This is line 11 This is line 12 This is line 12 This is line 12 This is line 13 This is line 13 This is line 13 This is line 14 This is line 14 This is line 14 This is line 15 This is line 15 This is line 15 This is line 16 This is line 16 This is line 16 This is line 17 This is line 17 This is line 17 This is line 18 This is line 18 This is line 18 This is line 19 This is line 19 This is line 19 This is line 20 kf ' jf This is line 20 This is line 20 This is line 21 This is line 21 This is line 21 This is line 22 This is line 22 This is line 22 This is line 23 This is line 23 This is line 23 This is line 24 This is line 24 This is line 24 This i kf ' jfs line 25 This is line 25 This is line 25 This is line 26 This is line 26 This is line 26 This is line 27 This is line 27 This is line 27 This is line 28 This is line 28 This is line 28 This is line 29 This is line 29 This is line 29 This is line 30 This is line 30 This is line 30 This is line 31 This is line 31 This is line 31 This is line 32 This is line 32 This is line 32 This is line 33 This is line 33 This is line 33 This is line 34 This is line 34 This is line 34 This is line 35 This is line 35 This is line 35 This is line 36 This is line 36 This is line 36 This is line 37 This is line 37 This is line 37 This is line 38 This is line 38 This is line 38 This is line 39 This is line 39 This is line 39 This is line 40 This is line 40 This is line 40 This is line 41 This is line 41 This is line 41 This is line 42 This is line 42 This is line 42 This is line 43 This is line 43 This is line 43 This is line 44 This is line 44 This is line 44 This is line 45 This is line 45 This is line 45 This is line 46 This is line 46 This is line 46 This is line 47 This is line 47 This is line 47 This is line 48 This is line 48 This is line 48 This is line 49 T kf ' jf his is line 49 This is line 49 This is line 50 This is line 50 This is line 50

Screenshots of txt file on vscode: image text in transcribedimage text in transcribed

This is line 1 This is line 1 This is line 1 This is line 2 This is line 2 This is line 2 This is listx ene ack stone 3 This is line 3 This is line 3 This is line 4 This is line 4 This is line 4 This is line 5 This is line 5 This is line 5 This is line 6 This is line 6 This is line 6 This is line 7 This is line 7 This is line 7 This exteve ACK stxis line 8 This is line 8 This is line 8 This is line 9 This is line 9 This is line 9 This is line 10 This is line 10 This is line 10 This is line 11 This is line 11 This is line 11 This is line 12 This is line 12 This is line 12 This is line 14 This is line 13 This is line 13 This is line 14 This is line 15 Thisenew ACK sTx is line 15 This is line 15 This is line 16 This is line 16 This is line 16 This is line 17 This is line 17 This is line 17 This is line 18 This is line 18 This is line 18 This is line 19 This is line 19 This is line 19 This is line 20 Exx kf ETEOC2' jferx stxThis is line 20 This is line 20 This is line 21 This is line 21 This is line 21 This is line 22 This is line 22 This is line 22 This is line 23 This is line 23 This is line 23 This is line 24 This is line 24 This is line 24 This is line 1 This is line 1 This is line 1 This is line 2 This is line 2 This is line 2 This is listx ene ack stone 3 This is line 3 This is line 3 This is line 4 This is line 4 This is line 4 This is line 5 This is line 5 This is line 5 This is line 6 This is line 6 This is line 6 This is line 7 This is line 7 This is line 7 This exteve ACK stxis line 8 This is line 8 This is line 8 This is line 9 This is line 9 This is line 9 This is line 10 This is line 10 This is line 10 This is line 11 This is line 11 This is line 11 This is line 12 This is line 12 This is line 12 This is line 14 This is line 13 This is line 13 This is line 14 This is line 15 Thisenew ACK sTx is line 15 This is line 15 This is line 16 This is line 16 This is line 16 This is line 17 This is line 17 This is line 17 This is line 18 This is line 18 This is line 18 This is line 19 This is line 19 This is line 19 This is line 20 Exx kf ETEOC2' jferx stxThis is line 20 This is line 20 This is line 21 This is line 21 This is line 21 This is line 22 This is line 22 This is line 22 This is line 23 This is line 23 This is line 23 This is line 24 This is line 24 This is line 24

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_2

Step: 3

blur-text-image_3

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

Understanding Financial Statements A Manager S Guide

Authors: David S. Murphy Ph.D. ,Ernest W. Murphy

1st Edition

1530688787, 978-1530688784

More Books

Students also viewed these Accounting questions