I don't understand. You say you want 3 lines from a file, but the 1st line of output you show comes from the first column of five (non-adjacent) input lines, and the 2nd and 3rd lines seem to come from the second column of five other non-adjacent lines.
What criteria are you using to select what you want to appear in the output?
I have to second Don Cragun, as it is a mystery to me what be your desired output and what be the logics to achieve it. Please explain in plain English what comes from where and goes to where, so we can start helping you.
Although you didn't bother to improve your specification, I think I picked up on what you want.
Instead of splitting the header line into an array, and then test all the $1s against this array in a loop for each input line, I dreamed up this one replacing the header text with its value for every instance of the datasets:
awk 'NR==1 {Ln = "UtranCellId administrativeState aseDlAdm aseUlAdm qQualMin" # header, used for data line format
print Ln # print header
tmp = Ln} # prepare data line
match (Ln, $1) {if (RSTART == 1 && tmp != Ln) {print tmp; tmp = Ln} # found new record - print old one, prepare new data line
sub ($1, sprintf ("%*s", RLENGTH, $2), tmp) # put data into data line with correct field lenght
}
END {print tmp # print last record
}
' file
UtranCellId administrativeState aseDlAdm aseUlAdm qQualMin
MDN407WI1 1 500 800 -18
MDN094W1 2 400 300 -18
If you need the entire state string incl. (LOCKED / UNLOCKED), make " +" the field separator, yielding