Sample Header Ad - 728x90

Extract specific value from blocks of data

2 votes
4 answers
274 views
I have the blocks of data which are differentiated by the global Ids as below. I need to extract the last block of data with the highest id value, in the below example, id="82". ---Remaining data--------- ---Remaining data--------- ---Remaining data--------- I can perform the below. However, it will restrict the id value to be two digits only. How can I derive the last block of data without putting the digits restriction on id value. data1=grep "gc type="global"" abc.log| cut -c24-26|tail -n1 lastdata="gc type="global"=$data1" sed -n '/'"${lastdata}"'/,$p' abc.log>last_block_data.log
Asked by alex (121 rep)
Jul 31, 2015, 01:06 PM
Last activity: Mar 10, 2025, 09:33 PM