Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. Switch the notebook to Python3. Using a Python loop generate 21 files with the names samples_nnnn.dat for numbers nnnn every 50 between 0 and

image text in transcribedimage text in transcribed

2. Switch the notebook to Python3. Using a Python loop generate 21 files with the names samples_nnnn.dat for numbers nnnn every 50 between 0 and 1000. Make sure the numbers are padded with zeros so that all file names have exactly 16 characters. Write into each file the number nnnn including the padding. Also create directory names of the format run_nnnn.dir. Move each file name samples_nnnn.dat into the corresponding directory. 3. Switch back to bash and continue in this notebook. Make a directory called Samples and move all run*dir directories into the Samples directory. Then paste the output of the following command ls -1 Samples/run_@[237]?0.dir/*dat tail -n 3 head -n 1 issued in the directory that contains the Samples directory into the quiz sample-case .) Add this file to your Lab 3.2 commit. 4. Execute the history command in such a way that the most recent 30 lines are redirected into the file history.txt. (Hint: this command line will include > and Also add the Lab notebook (this notebook!) to the commit. /mp248 / Labs / Name abc 3.1_Lab.ipynb - 3.2_Lab.ipynb kant-metaphysical-145.txt random.dat reason.txt Last Modified 8 minutes ago 2 days ago 2 days ago 2 days ago 2 days ago 2 days ago

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

More Books

Students also viewed these Databases questions