Search Name match with specific Character and output comes in hierarchical Order

Please read this about how to format.