I'm using grep on text file containing some simple logs in the following form:-
[ABC.txt]
1=abc|2=def|3=ghi|4=hjk|5=lmn|6=opq
8=rst|9=uvx|10=wyz
.
.
.
.
and so on
the values for the tags 1,2,3,4 etc are different throughout the file and include special characters in some case too. Is there a way I can only retrieve the value for the tag 4 and no other tags via GREP?
BTW,this log file is itself a result of grep .So please advice if I should redirect the output first and then apply the second grep or apply the second grep over the first one,considering it's a large file.