If you are not bothered about sequence of field 1st as per your Input_file then following may help you in same.
Output will be as follows.
In case you need output into same order as per Input-file(sorted order) then following may help you in same.
Output will be as follows. EDIT: Adding a non-one liner form of solutions here.
Solution1:
Solution2:
Thanks,
R. Singh
Last edited by RavinderSingh13; 08-18-2016 at 02:59 PM..
Reason: Added non-one liner form of solutions now.
This User Gave Thanks to RavinderSingh13 For This Post: