I have a file like this, and I want to search for pattern matching "/4126/" and print only the month and year and the amount (the amount is not always in Jan 2014 as in example below).
awk -F! '/4126/ {print $0}' prints the entire line
But I need to get it printed only the month/year and amount as follows :
Jan 2014
25492.00
A sample from the file is given here.
+=====================================================================+
! Code ! Jan 2014 ! Feb 2014 ! Mar 2014! Arrears! T o t a l s !
+=====================================================================+
! 1101 ! 26290.00 ! 26290.00 ! 26290.00! 0.00 ! 3,15,480.00 !
! 1102 ! 480.00 ! 480.00 ! 480.00! 0.00 ! 5,760.00 !
! 2104 ! 24213.09 ! 25198.97 ! 25198.97! 0.00 ! 2,73,205.69 !
! 2107 ! 0.00 ! 0.00 ! 0.00! 0.00 ! 14,991.20 !
! 2113 ! 275.00 ! 275.00 ! 275.00! 0.00 ! 3,300.00 !
! 4114 ! 0.00 ! 0.00 ! 1106.00! 0.00 ! 4,424.00*!
! 4123 ! 4667.00 ! 0.00 ! 0.00! 0.00 ! 4,667.00 !
! 4126 ! 25492.00 ! 0.00 ! 0.00! 0.00 ! 25,492.00*!
Please provide me awk formula to do this. Thanks in advance.