Could you please try following(since OP mentioned no other tools present for OP and guidance needed in awk
or shell so going with this solution). I am passing Input_file
to awk
command if you are passing your_command output to awk
then change following to like your_command | awk.....
awk '
match($0,/name="[^"]*/){
val1=substr($0,RSTART,RLENGTH)
match($0,/value="[^"]*/)
val2=substr($0,RSTART,RLENGTH)
sub(/.*"/,"",val1)
sub(/.*"/,"",val2)
print val1"="val2
val1=val2=""
}' Input_file
Explanation: Adding detailed explanation for above.
awk ' ##Starting awk program from here.
match($0,/name="[^"]*/){ ##Using match to match from name=" till next " comes in current line.
val1=substr($0,RSTART,RLENGTH) ##Saving sub string of current line into val1 here.
match($0,/value="[^"]*/) ##Using match to match a regex from value=" till next occurance of " in current line.
val2=substr($0,RSTART,RLENGTH) ##Saving sub string into val2 which has previous match RSTART RLENGTH values.
sub(/.*"/,"",val1) ##Substituting everything till " in val1 here.
sub(/.*"/,"",val2) ##Substituting everything till " in val2 here.
print val1"="val2 ##Printing val1 = and val2 here.
val1=val2="" ##Nullify val1 and val2 here.
}' Input_file ##Mentioning Input_file name here.