Question: 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
Get step-by-step solutions from verified subject matter experts
