Professional Documents
Culture Documents
ItemName|MAxCount|MinCount|Location|InCharge
Notepad|500|50|PP|Akhil
Marker|100|20|CLC|Ajith
Pen|700|10|PP|Akhil
Pencil|500|30|CLC|Vinay
Eraser|200|25|PP|Ajith
StickyNotes|400|15|PP|Vinay
Notepad|300|5|CLC|Vinay
ANS :-
[u1352325@INTVMAO01 ~]$ awk -F '|' '$1 == "Notepad"' FILE4 |awk -F '|' '{total+=$2}
END{print total/NR}'
400
2. Write a command to sort the items in the increasing order of minimum count
[u1352325@INTVMAO01 ~]$ awk -F '|' '$5 == "Vinay"' FILE4 |awk -F '|' '{print $1}'
Pencil
StickyNotes
Notepad
[u1352325@INTVMAO01 ~]$ awk -F '|' '$1 == "Pen"' FILE4 |awk -F '|' '{print $3}'
10