Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Bash / Shell script The input is multiple lines of comma-separated text. Within the lines having DATA in the first field (l.e. the first commaseparated
Bash / Shell script The input is multiple lines of comma-separated text. Within the lines having "DATA" in the first field (l.e. the first commaseparated value within a line), you need to find the largest of the last 5 numbers in the second field. IMPORTANT: Assume that the input will be provided on STDIN. Example: Given the following input on STDIN DN:, 1 INFO, 0 , this is not important, 19 DATA, 2, optlonal, flelda DATA, 3 DATA, 5, optional, flelda DATA, 6 IGNORE, 0 , you, should, 1gnore, this, line DATA, 7, optional, fielda DATA, 9, optional, fielda DATA, 8 The first line has tag-"DATA" and number-" 1 ", whereas the second line has tag=" INFO" and number-" 0 ", Then, the last "DATA" numbers are 5, 6, 7, 9,8 (shown in bold in the example) the answer is "9". Your script should print " 9 " to stDOUT. Input: - Multiple lines of comma separated fields (STDIN). - Each line has at least two comma-separated fieks. - me second field has a valid number onfy for Datay lines. - There is always at least one 'Data' line
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started