Could you please go through following and let me know if this helps you.
awk -F'[=|:-]' ##### Setting field separator as = OR :-
'/end/ ##### Searching for text end here.
{print Q; ##### print the value of variable Q here.
Q=A=""} ##### Nullifying values of variables Q and A here.
/start/ ##### Searching for text start here.
{A=1; ##### Setting value of variable A as 1 here.
next} ##### putting next here so that all next statements will be skipped.
A ##### Checking condition if value of variable A is not null.
{Q=Q?Q","$NF:$NF}' ##### if above condition is TRUE then execute this, to make the value of variable named Q.
Q=Q checking condition if Q's value is NOT NULL then execute actions after ?
which is to concatenate the value of already existing variable Q with Q","$NF(current line's last field)
If above mentioned condition is NOT TRUE then execute actions after :
which is to keep value of variable Q as $NF only no need to concatenate it.
Input_file ##### Mentioning the Input_file here.
Not sure if you have gone through my all explanation, Q's value is getting assigned in below steps so it has been explained there, let me know if you have any queries(Off course after going through all my explanation only).
@Corona688 .... this forum is not to give exact and complex answer. Person who is asking question needs to learn as well. Hence i used cat and grep so that by executing person can learn.:D:D
sets four field separator characters = , | , : , and - . Each of those characters are matched by the ERE bracket matching expression containing those four characters. If you want to use the two strings = and :- as field separators, leave off the brackets:
awk -F'=|:-'
which specifies an ERE containing two alternatives with the | separating the alternatives.
Thanks for reminding. I do, but this would be achieved by the subsequent paste. In my comment, I just rewrote three commands of the pipe (cat/grep/grep) into a single one. Applying this to the whole solution - given the other comments on this topic - is trivial.