I have a file with entries that have the form:
SMS-MT-FSM-DEL-REP
country: IN
1280363645.979354_PFS_1_1887728354
SMS-MT-FSM-DEL-REP
country: IN
1280363645.729309_PFS_1_1084296392
SMS-MO-FSM
country: IR
1280105721.484103_PFM_1_1187616097
SMS-MO-FSM
country: MO
1280105721.461090_PFM_1_882824215
This can be parsed through awk using something like: awk 'BEGIN {FS = "\ n"; RS = ""} / country:. * MO / {print $ 0} '
My question is, how can I use awk to search for entries in 2 separate fields? For example, I just want to print the records in which the country of MO is, and the first record of the record is SMS-MO-FSM?
source
share