Hi,
I have a huge de-limited file which has pattern :
99"9876"2010-11-21 12:51:01"J"MNOPQRS ID# 2-1234-1234-0099-9876-0 "" <<read>>
99"9876"2010-11-21 12:51:01"K"R-EMP# 01234567 (LOGOFF) "" <<read>>
99"9876"2010-11-21 12:51:01"L" *AUTO LOGOFF* "" <<read>>
99"9876"2010-11-21 12:51:01"M"END OF XXXXXXXXXXX #5180 END:12:51 PM "" <<read>>
99"9876"2010-11-21 12:51:01"N"-2798 0 0 418 0 "" <<read>>
99"1234"2010-11-21 12:12:12"J"MNOPQRS ID# 2-1234-1234-0099-1234-0 "" <<read>>
99"1234"2010-11-21 12:12:12"K"R-EMP# 01234567 (LOGIN) "" <<read>>
99"1234"2010-11-21 12:12:12"L" *AUTO LOGIN COMPLETED* "" <<do not read>>
99"1234"2010-11-21 12:12:12"M"END OF XXXXXXXXXXX #5180 END:12:12 PM "" <<do not read>>
99"1234"2010-11-21 12:12:12"N"-2798 0 0 418 0 "" <<do not read>>
99"5678"2010-11-21 12:10:01"J"MNOPQRS ID# 2-1234-1234-0099-9876-0 "" <<read>>
99"5678"2010-11-21 12:10:01"K"R-EMP# 01234567 (OPEN) "" <<read>>
99"5678"2010-11-21 12:10:01"L" *AUTO LOGOFF* "" <<do not read>>
99"5678"2010-11-21 12:10:01"M"END OF XXXXXXXXXXX #5180 END:12:10 PM "" <<do not read>>
99"5678"2010-11-21 12:10:01"N"-2798 0 0 418 0 "" <<do not read>>
I'm reading each line (while loop) and parsing the values to an output file based upon column-4.
When it reads 'K' type of line it extracts the value within the brackets in the last column(here, LOGOFF).
I need to achieve this:
If it is equal to LOGOFF or TURNOFF or CLOSE read the next lines as usual continously. If it is not equal to LOGOFF or TURNOFF or CLOSE, do not read the next lines that have the same combination of values present in column-1,2,3.
Here, do not read a line that has values
'column-1=99' && 'column-2=1234' && 'column-3=2010-11-21 12:12:12'
Using grep for searching the pattern and break for not reading the line is prefered.