Welcome to UNIX and Linux forums, hope you will enjoy sharing and learning knowledge here. Following explanation may help you in your question.
awk 'NF==1{ ##checking condition here if NF(number of fields on current line) is 1 then do following.
$3=$1; ##Setting 3rd field value same as 1st field value.
$1=L} ##Setting 1st field value as the value of variable L here.
P&&NF>=3{ ##checking condition here if variable P is NOT NULL and NF is greater OR equal to 3 then do following.
print $1,$3; ##Printing 1st and 3rd fields values here.
L=$1} ##Setting variable L value as $1 of current line.
/^___/{ ##checking condition here if a line starts with ___ then do following.
P=1} ##Setting variable P value to 1 here.
' FILE ##Mentioning Input_file name here.
Thanks, RavinderSingh13, for this explanation. Small, nit-picking side remark: Nothing can be "greater than" AND "equal to" something, that's mutually exclusive. "Greater than or equal" would perfectly describe that test's operation.
@green_k: P is used as a logical or boolean variable here. A zero value (or unset) represents a boolean FALSE value, any other, esp. 1, represents TRUE. You can see that when P itself is used as a (sub-) pattern, without an operation like a test done on it. P && ... reads like if (P is TRUE) and ... .