Dynamic delete and replace

I want to replace the values if my object has specific or any value & if it does not have then I would like to delete the corresponding field it can be textbox, checkbox or table. How could this be done?

@nileshmishra Could you please attach your input and expected output documents here for our reference? We will check your documents and provide you more information.