Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

## Part-1: ## ======= The below shell script creates a file file1.txt with one million records of random numbers: for i in {1..1000000} do echo

## Part-1: ## =======

The below shell script creates a file file1.txt with one million records of random numbers:

for i in {1..1000000} do echo $RANDOM >> file1.txt done

## Part-2: ## =======

The below Python code reads record from above file1.txt, calculates the double of that number and then write the result in file2.txt:

f1 = open("file1.txt",'r') all_lines = f1.readlines()

f2 = open("file2.txt",'w') dn = 0

for l in all_lines: dn = int(l) * 2 f2.write(str(dn) + ' ')

f2.close()

## Task: ## =====

Break the input file "file1.txt" (from above) into 5 files/chunks and schedule the Python code (mentioned in Part-2) on each one to run in "real-time", then combine the resulting files into a single output file.

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

Multidimensional Array Data Management In Databases

Authors: Florin Rusu

1st Edition

1638281483, 978-1638281481

More Books

Students also viewed these Databases questions