Sed awk text formating : I would like to filter and order text files with soemthing like awk or sed. It does not need to be a single command, a small bash script should be fine too.

 

#

home=address01

name=name01

info=info01

number=number01

company=company01

#

name=name02

company=company02

info=info02

home=home02

#

company=company03

home=address03

name=name03

info=info03

info=info032

number=number03

company=company032

#

....

 

I only need name, number, and info. There is always exactly one name, but there can be 0,1 or 2 number and info. The # is the only thing which is consistent and always on the same spot.

output should be:

name01, number01, , info01,

name02, , ,info02,

name03,number03, , info03, info032

 

Thanks for your help!

