Appreciate if any help for below query. Will require bash script. I am new to this scripting technology.
I have the below file at some location - say filename as MemberFile.txt.
# [ID ] #1 [ADDRE1 ] Address Line #1 [ADDRE2 ] Mumbai City [ADDRE3 ] India # [ID ] #2 [ADDRE1 ] House No 2 [ADDRE3 ] Green Society [ADDRE4 ] Kolkatta # [ID ] #3 [ADDRE1 ] Plot Num 77 [ADDRE2 ] House No #  [ADDRE3 ] greener Apt #
File can have millions of such records. I wanted to quickly iterate through each record and get and store value for
[ADDRE3 ]. Also check if that record contains either of word 'society' or 'Num' (case insensitive). If yes, then get value of tag
[ID ] in that record.
Expected output is #2 and #3.
Please note that below one represents one record.
[ID ] #1 [ADDRE1 ] Address Line #1 [ADDRE2 ] Mumbai City [ADDRE3 ] India